Want a!pickerFieldCustom() to do starts with search rather than like search

I am working on version 17.4.

I am using a!pickerFieldCustom() to allow users to choose from a text array using an auto-completing picker. The labels as well as the values stored at selection are abbreviations and not long names.

The code snippet is as follows:


  local!stateAbbreviations: { "AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY" },
    label: "State of Residence",
    instructions: "Value saved: " & local!pickedState,
    placeholder: "Type to select the employee's state of residence",
    maxSelections: 1,
    suggestFunction: rule!ucArrayPickerFilter(
      filter:_ , 
      labels: local!stateAbbreviations, 
      identifiers: local!stateAbbreviations
    selectedLabels: index(local!stateAbbreviations, wherecontains(local!pickedState,local!currencyValues)),,
    value: local!pickedState,
    saveInto: local!pickedState

In this case what happens that say if user types "A", then the options available to him to choose from are AL, AK, AZ, AR, CA, GA, IA, MA, PA, VA, WA; since it searches for A in the entire array. However, my requirement is; it searches for only the values which start with A i.e. it should return only the options AL, AK, AZ, AR to choose from.

Any suggestions how to achieve this.

Thanks in advance!!

Parents Reply Children
No Data

 Discussion posts and replies are publicly visible