Skip to main content
taavonb4494
Participating Frequently
Oct 12, 2022 2:03 PM UTC
Question

Dropdown choicelabels and choicevalues

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

    Participating Frequently
    Oct 12, 2022 3:50 PM UTC

    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
    Oct 12, 2022 4:01 PM UTC

    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.

    Participating Frequently
    Oct 12, 2022 4:03 PM UTC

    Yes, just gave sample one.