Skip to main content
November 15, 2021
Question

a!pickerFieldCustom

  • November 15, 2021
  • 4 replies
  • 0 views

Hi All,

I have below requirement where Pickerfield to start search only when user enters more than 4 characters, else it should not search in the background. Appreciate your response here. 

Thank you !

4 replies

vinayp0002
November 15, 2021

Hello Vamsy,

Please add that condition in the suggest function stating that it should show search results when user enters more than 4 characters.

if(
len(ri!search)<=4,
todatasubset({}), {-- your code})

November 15, 2021

Hi VInay,
Appreciate your time and response. However, my picker fields input is not coming from ruleInput. It will be as part of userInput in the pickerfield component. 

example:

 a!pickerFieldCustom(
        label: "States",
        instructions: "Enter the employee's state of residence.",
        maxSelections: 1,
        suggestFunction: rule!ucArrayPickerFilter(
filter: _
), value: local!pickedState, saveInto: local!pickedState, showWhen: local!showPicker )


So my search should happen only when user input has more than 3 characters. 

vinayp0002
November 15, 2021

If that is the case you can modify your suggestFunction or you can create your own expression for that rule which would help in your case.