Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello ,
i want to assign value to multibox items based on another multibox selected items .can any body help me on this ?
regards
add it inside the search substring textbox as,
=if(getselectedcount(Company)>0,chr(39)&GetFieldSelections(Company,chr(39)&','&chr(39))&chr(39))
can you please check attached file ,i have done the same but it is not working.
ass it in the search string place
Sorry, I have QV personal edition, so cannot open your doc.
Image/sample data or the script will do it.
First, you are using alternate states. You need to specify which alternate state the action applies to, it's next to the Delete button in action settings (presumably, Ad Hoc state).
Second, I don't think this search string will work, because one does not simply put quotes in search strings (unless one explicitly wishes to search for quotes). Use this formula instead:
=if(GetSelectedCount(Company)>0,'('&GetFieldSelections(Company,'|')&')')
This will return current selections (without quotes) separated by | and wrapped in parentheses, which is the search string syntax for "or".
It is not working cus there is no link between tables/fields in your data model. That might be the issue.
thanks ,the expression is working at least when one item is selected but what should i do for muti selection scenario?
You can try this code snippet also, for multiple or single selection.
=if(GetSelectedCount(Company) >0,'(' & Concat(Distinct Company, '|') & ')')
Please explain your requirement so that it will be easier for us to understand also share the sample data.
Nothing. This will work for multiple selections as well, try it. Only issue is that GetFieldSelections function will return results like "7 of 22 selected" if there are too many values selected. That can be worked around with third argument, which specifies after how many values it should switch to the shortened form:
=if(GetSelectedCount(Company)>0,'('&GetFieldSelections(Company,'|',FieldValueCount('Company'))&')')
(the selection limit is set to be equal to number of values in the field)
Alternatively, you can use the version with Concat as suggested by Ganesh.