Announcements
cancel
Showing results for
Did you mean:
Partner - Creator

## Creating a dynamic listbox based on input box

Hi Guys,

I want to know if something like this is possible, the idea is simple, Suppose I have the following dimension with the following data.

Salary = {400, 500, 600, 1000, 2000, 2500, 3000}

Now I want to have a Listbox of this data but I want it to be based on two input boxes, lets call the input boxes "Min Range" and "Max Range", now what i want to happen is if I for example write 1000 in Min Range box, and 2500 in Max Range box, then the Listbox would only show values between these two numbers, so in my case it would be {1000,2000,2500}.

if nothing is in the input boxes, then show all values, but if for example, only min range is filled, then the Listbox should start from that number and go all the way to the end with no max limit, and the same goes for the min limit if its the empty one. Can something like this be done in a dynamic way, meaning the listbox repopulate itself every time a key is pressed inside the input boxes?

I'm not an absolute professional, I'd highly appreciate a step by step on what to do here

Thanks A lot

1 Solution

Accepted Solutions
Former Employee

Yes you can do this if you instead of a field write an expression in the list box:

=Aggr(Only({\$<Salary={">=\$(Min Range)<=\$(Max Range)"}>} Salary),Salary)

HIC

3 Replies
Former Employee

Yes you can do this if you instead of a field write an expression in the list box:

=Aggr(Only({\$<Salary={">=\$(Min Range)<=\$(Max Range)"}>} Salary),Salary)

HIC

Partner - Creator
Author

that's exactly what i'm looking for, would it be possible to share the application with me so i can take a closer look?

Not applicable

Hi,

you can store inputbox values in variables (its an inputbox property). Lets call the variables vMinRange and vMaxRange.

Then you have to create reactions triggered by inputing variable value.

You set it by choosing Settings -> Document settings -> Triggers -> variable event triggers -> Add action

and then add "Select in field" action.

As field enter Salary, and as search string enter following formula:

='>='&if(trim(vMinRange)='',min(Salary),\$(vMinRange))&'<='&if(trim(vMaxRange)='',max(Salary),\$(vMaxRange))

Community Browser