Skip to main content
Participating Frequently
Nov 15, 2021 1:27 AM UTC
Question

a!pickerFieldCustom

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
Participating Frequently
Nov 15, 2021 3:55 AM UTC

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})

Participating Frequently
Nov 15, 2021 1:13 PM UTC

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
Participating Frequently
Nov 15, 2021 1:28 PM UTC

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.