Skip to main content
taavonb4494
October 12, 2022
Question

Dropdown choicelabels and choicevalues

  • October 12, 2022
  • 4 replies
  • 0 views

Hello everyone I am new to Appian and I wanted add data from a recordtype to the dropdown but I can't seem to figure it out. I tried different ways but I've got nothing. Can anyone asisst?

    4 replies

    October 12, 2022

    You can refer https://docs.appian.com/suite/help/22.3/Dropdown_Component.html for dropdown component. For displaying data from record type use a!queryRecordType function  and then pass it choice labels and choice values based on your requirement.

    Please refer https://docs.appian.com/suite/help/22.3/Query_Recipes.html to know more about how to query from record.

    sample code

    {
    a!dropdownField(
    label: "LabelName",
    labelPosition: "ABOVE",
    placeholder: "--- Select a Value ---",
    choiceLabels: a!queryRecordType(
    recordType: yourRecordName,
    fields: {},
    pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 100)
    ).data[access the fiield],
    choiceValues: a!queryRecordType(
    recordType: yourRecordName,
    fields: {},
    pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 100)
    ).data[field],
    saveInto: {},
    searchDisplay: "AUTO",
    validations: {}
    )
    }

    Participating Frequently
    October 12, 2022

    Hi, Sandya instead of querying the data twice we can call it in the local variable and then index it in choice labels and values.

    And we can insert the code using the code box.

    October 12, 2022

    Yes, just gave sample one.