In drop down choice labels and choice value ..can we display value based on if conditions..
I need to display value in drop down based on the product availability..
And I have around 10 products
Can someone help with codes
Discussion posts and replies are publicly visible
Can you provide some more details? What are the logical conditions under which you're expecting to see different dropdown choices? Are these conditions affected by other on-form elements (i.e. dynamically changeable by the user), or decided beforehand so the values on the form in question will be relatively static? There are different implementation patterns depending on the answers to these questions (among others).
Drop down field(
Label:''available"
Choice labels: if (local! quantity<cons! QUANTITY), local! quantity,{}),
Choice value: cons! QUANTITY,
Value: local!data,
Saveinto: local! data,
)
Cons! QUANTITY: It has value {1,2,3,4..10}
My drop-down is inside for loop.
When am using same if condition in choice value it's throwing error.
What am trying is if the product is available less than 10 then only that no. Should display as drop down value.
Well there's your first problem - choiceLabels and choiceValues are both arrays, and they must always exactly match in length. "Labels" is what the user sees and "Values" is what's saved when the corresponding entry is selected. If you're going to conditionally show/hide members in the dropdown, you must do the exact same transformation on the lists you're passing on for both.
Thanks Mike... It would be of great help if you can provide any working code
I (or someone else) can do that, but you'd need to provide some more details first.