Hello,
I'm working with a custom picker that should allow one selection. A different selection should be made by removing the first selection.
Currently, when a user types, makes a selection, and then keeps typing, the input is filled with 50 seemingly random selections. These selections do not save. When typing slower and allowing the dropdown to fully load, it works as wanted. Any ideas on how to fix this? Thank you
a!pickerFieldCustom( label: "Name", labelPosition: "ABOVE", placeholder: "--- Select a Name ---", saveInto: local!selectedPerson, suggestFunction: rule!AST_GETNAMES, selectedLabels: if( a!isNullOrEmpty(local!selectedPerson), null, index(rule!AST_GETUSERFROMARRAY(suggestionText:local!selectedPerson), "data") ), value: if( a!isNullOrEmpty(local!selectedPerson), null, index(rule!AST_GETUSERFROMARRAY(suggestionText:local!selectedPerson), "data") ), required: true, validations: {}, disabled: false, maxSelections: 1, /* Only allow one name to be selected at a time */ ),
Discussion posts and replies are publicly visible
It's not clear to me. Provide more details.
If you have maxSelections:1, the component should not allow you to type anything once you have selected one item.
Agreed, that's what I can't figure out. I added the rule!AST_GETUSERFROMARRAY above if that adds context. Thank you
Hi Kylie ,
In the Picker Field, you have called the rule ---> index(rule!AST_GETUSERFROMARRAY(suggestionText:local!selectedPerson), "data") in SelectedLabels And Values. This is the reason why you are getting 50 values (which is in batch size of your pagingInfo)
Give the same local variable in VALUE parameter as you have given in SAVEINTO parameter and in SelectedLabel try to add logic for how your selection value should be displayed.
Please refer the link for how to configure Custom Picker Field