Dropdown based on record field values

Hi! I wanted to create a dropdown for each id generated in one of my records. How can I reference the values into the choice labels and choice values?

I thought about pointing to a constant of the record type column "id", but I´m not sure how to generate it

Thanks a lot!

  Discussion posts and replies are publicly visible

  • Query your records into local!dropdownValue (for example only)

    choiceLabels: local!dropdownValue[recordType!myRecordType.readableValue],
    choiceValues: local!dropdownValue[recordType!myRecordType.id],

    In the above i'm assuming fields named "readableValue" (basically whatever field in the record type you'd like to show as a text label for the dropdown entries), and "id" which you mentioned.

  • 0
    Certified Lead Developer

    Hi Carlos, If I understand well the use case, you just need to save a value that is taken for a dropdown to a field of the record, right?

    Then what I would do is:

    1. Generate a constant with the Choice values
    2. Generate a constant with the Choice labels
    3. Put those constants as choiceLabels and choiceValues in the a!dropdownField
    4. In the SaveInto of the a!dropdownField, save the value selected to the record field: saveInto: {recordType!myRecordType.Whatever}

    I hope it helps.