Custom Picker

I must be missing something simple as I cannot even get the sample to work for my custom picker.

I have created this expression rule:

And then, this is everything on my interface:

a!localVariables(
local!pickedState,
local!stateLabels: { "Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming" },
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" },
a!pickerFieldCustom(
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!stateLabels,
identifiers: local!stateAbbreviations
),
selectedLabels: a!forEach(
items: local!pickedState,
expression: index(local!stateLabels, wherecontains(fv!item, local!stateAbbreviations))
),
value: local!pickedState,
saveInto: local!pickedState
)
)

When I type into the form box, the only results that appear are an "A".  And when that is selected I get the following error:

Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function a!pickerFieldCustom [line 5]: A custom picker component [label="State of Residence"] has an invalid value for "value". The value and selectedLabels lists must be the same length.

Any help would be greatly appreciated.

Thanks!

  Discussion posts and replies are publicly visible

Parents Reply Children