Use textbox to filter a baq, kinetic dashboard

Hello EpiUsers!
I’m making a kinetic dashboard and I’m trying to filter my BAQ with whatever value is entered in this textbox.


The textbox id is mySearch. I’m trying to grab it’s value to filter the BAQ by putting it in the Where List (using this syntax '${mySearch}'). I know I can filter the BAQ if I hardcode a value, but I can’t seem to grab a dynamic value from my textbox.

Any idea what I’m doing wrong? Could anybody point me in the right direction?

textbox id

hardcoded filter

You’ll have to bind your text box to a data view and column (like TransView.mySearch) in the EpBinding field, then use that full name in your Where List: '?{TransView.mySearch}'

(You might have to initialize TransView, if that hasn’t already been done)

3 Likes

Agree with @jwphillips, you need a full binding for your field. You can’t just call out a control ID. You need to call out where the “value” that is being displayed in that control (textbox) is being stored in a DataView. Then you reference that full binding in your “Where”.

If you can’t get it to work, you can also try backing up one screen in your Grid Settings… instead of using a “Where List”, you can just set a Where Clause in the BAQ Options.

Below is an example. Here, UD02_Key1 is the column in my BAQ and I’m setting that equal to ‘??{KeyFields.PartNum}’

image

1 Like

Thank you both for the feedback & direction!!!

I’m now trying to bind my textbox to TransView.Search. I created this dataview called TransView.


And I’m trying to initialize it with On Create, run an event.
Is this how I initialize the TransView dataview??? Saw something similar here.

But its still not applying the filter. I guess I’m expecting it to filter upon typing or hitting the enter key.
What am I missing? Do I need another event? What else can I try?



When you debug in the browser (Ctrl + Alt + 8), you can hit Ctrl + Alt + V to dump the data in all the data views - then you can see what the value of your TransView.Search value is - and confirm that it’s getting set and not getting cleared, etc

It also helps to look at the Network tab and see what your ExecuteBAQ calls look like - to confirm that your where clause is getting set (or not)

1 Like

Finally got this working. This is how I was able to achieve a search box for a BAQ in application studio.

Create New Dashboard

  1. First, created a new application, no wizard, Type: Dashboard.

Create DataViews

  1. Created two dataviews. One for the BAQ, which I used the wizard to create. And a manually created one which I named TransView. TransView holds the value of the textbox.

Add UI elements

  1. Added a grid to the screen.
  2. Added a textbox to the grid, & updated its label and ID, of my choosing.

Binding & Initializing Search

  1. IMPORTANT - Bind the textbox to the dataview (TransView). This needs to be done BEFORE adding the behavior event to the text.

  2. Now that the textbox is bound to the dataview, I added an On Create behavior to the textbox. (I think this is the initialization?) This should be…
    Type: Ep Binding
    Hook: onInit
    Target: TransView.Search

NOTE - If you try to create the behavior before binding, the behavior event will default as Type: control and some other setting that won’t work.

  1. Add to that event a row-update with parameters > columns
    Ep Binding: TransView.Search
    No Expression, No Value, No Data Type.

Adding Data to Grid

  1. Go back to your grid > Grid Model > Provider Model, and add these…
    Ep Binding: dvMenuTracker (your BAQ dataview)
    Baq ID: MenuTracker (your BAQs actual name)

  2. Then go to your grid > Grid Model > Provider Model > Baq Options > Where List, add a new where list item. The column will be the column you want to filter by, condition and Value. The value will be something like '??{TransView.Search}'

That’s it! Now i can type, tab, and it searches.
searchGif

Bonus - You can make the conditional a contains instead of exact match by using condition: like and value: '%??{TransView.Search}%'

8 Likes