Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Multiple selection in a Search box

Hi, i need to create a search box related to a field admitting multiple values, using one of these 2 options:

- upload a text/csv/xls file

- insert a string of values like value1, value2, value 3

Any idea on how to proceed?

Thanks in advance

Bruno

1 Solution

Accepted Solutions
swuehl
MVP
MVP

The second option could be implemented like this:

- create an input box with variable vTest

- enter the values in the Input box, comma separated: 01,02,04,06

- Create a button with action Selection - Select in field

- Enter the field name you want to search for and as search string:

='('&replace(vTest,',','|')&')'

See also attached.

If you manage to read in your file, you could reuse the button with action also for option 1.

Hope this helps,

Stefan

View solution in original post

9 Replies
swuehl
MVP
MVP

The second option could be implemented like this:

- create an input box with variable vTest

- enter the values in the Input box, comma separated: 01,02,04,06

- Create a button with action Selection - Select in field

- Enter the field name you want to search for and as search string:

='('&replace(vTest,',','|')&')'

See also attached.

If you manage to read in your file, you could reuse the button with action also for option 1.

Hope this helps,

Stefan

Not applicable
Author

unfortunately I need to give the user the opportunity of  entering multiple selection which are different every time

swuehl
MVP
MVP

Hm, not sure if I understand: What's wrong with entering these values in the input box as string, comma separated, then?

At least this is how I understand you initial post regarding option 2.

Not applicable
Author

Sorry, you are right it is working correctly!

Just one question: do you know how many values is possible to enter in?

swuehl
MVP
MVP

I know of no limitation for variable length.

Another idea: Instead of using a button action, you could also use a trigger on variable set / change in document properties, so just entering / changing values will already do the job.

Using the expression dialog for entering the values also allows quite easily to copy / paste your values from an external file.

Not applicable
Author

Is it possible to use another separator?

I was thinking to (*), how i have to rewrite the search string?

swuehl
MVP
MVP

You are talking about the comma in your input box as separator, right?

This separator is replaced by the replace function with the separator needed by the search string (this you can't change):

='('&replace(vTest,',','|')&')'

So just replace the second parameter ',' with '*':

='('&replace(vTest,'*','|')&')'

Anonymous
Not applicable
Author

Hi,

Thanks for sharing the post. I have implemented this and its working fine on development machine.

But "Edit expression button" is not visible after deployment.

I am missing something or its browser issue.

Thanks

Sandeep

Rafmat
Contributor
Contributor

Hello,

One way to easily accomplish what you would like to do is to create a list box for the required field that need to be search for.

In the List Box properties, in the "General" folder, select the field that need to be listed and select "Wildcard search" for "Default search mode", in the "Sort" folder select  "Auto ascending" for "State"and in "Caption" folder tick or select SEARCH in the "Special icons" window.

The user can then use the magnifier (search icon) that is displayed in the Title caption of the listbox to look for multiple value. He will have to search the first data, then select it, search another data,  but before selecting it keep CTRL Key pressed while selecting the data etc ...

Each selected data will appear on the top of possible data in the listbox

Of course you can use a button to toogle on/off the display of the listbox for convenience purpose.