Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
In a listbox can I specify which items to list ? For example the Product dimension has Product A to Product Z but if I only want the user to select from : Product A, Product D, Product K or Product R. Can this be hard-coded in the the expression and how ?
Thanks.
Where have you put that expression into? You need to use a field expression (on general tab of the list box properties, open the field drop down, then select <Expression> from the bottom of the drop down menu).
I assume you have put the expression in there and not to the expression tab, right?
If the dimension Product holds values as you indicated above, jsaradhi's solution should work.
Instead of the if() statement with the many comparisons, you can also use
=if( Match(Product, 'Product A', 'Product D', 'Product K', 'Product R'),Product)
to hardcode, use an if condition...something like:
=if(Product='Product A' or Product='Product D' or Product='Product K' or Product='Product R', Product)
clearly, more the number of products you want to display, the longer the condition. a better way would be to create a new field in the script and use the new field in list box.
Thanks for your response. The IF statement did not work - still displays all items. Maybe i'll just create a variable or a new field.
interesting...i just tested it on my end and it worked...do you think you can share a sample qvw? or post a screenshot of your expression?
Where do you exactly write the condition?
You must do it in the General Tab. In the dropdown of field. There is an option <Expression>, if you click the Edit button it will show an editor, that's the place to put it.
If you write the condition in the Expressions Tab it won't work.
Where have you put that expression into? You need to use a field expression (on general tab of the list box properties, open the field drop down, then select <Expression> from the bottom of the drop down menu).
I assume you have put the expression in there and not to the expression tab, right?
If the dimension Product holds values as you indicated above, jsaradhi's solution should work.
Instead of the if() statement with the many comparisons, you can also use
=if( Match(Product, 'Product A', 'Product D', 'Product K', 'Product R'),Product)
Thanks Everyone, it worked !
I was putting it in the Expression tab, not the General tab.