Skip to main content
April 23, 2024
Question

DropDown value with expression rule

  • April 23, 2024
  • 4 replies
  • 0 views

Hi!

As my requirement i need to queryRecordtype .
Based on the results of a query using an expression rule in the interface dropdown
I would like to select id when name is selected as shown in the image below.

Thanks

4 replies

davidj137213
April 23, 2024

And the question is?

girlc0001Author
April 23, 2024

My question is......

In the attached image, I was able to use recordtype, but if I use an expression rule, how can I  get ID when I select Name?

konduruc733182
April 23, 2024

Simply index the name for the choice labels and ID for the choice values.

a!localVariables(
  local!data:rule!DATA_ExpressionHere(isActive: true),
  local!val,
  a!dropdownField(
    placeholder: "Select",
    choiceLabels: index(local!data,'recordType!recordType.fields.label',null),
    choiceValues:  index(local!data,'recordType!recordType.fields.id',null),
    saveInto: local!val,
    value: local!val
  )
)