Skip to main content
New Participant
Aug 18, 2025 8:44 PM UTC
Question

How do I call upon a dependent dropdown field?

Hi all!

New to Appian, and I am stuck on figuring out how to correct configure a dependent dropdown. 

The first dropdown field is called "Plant," and its fields consist of plantId, value, & description. The second dropdown field is called "Storage Location," and its fields consist of werks, name1, & land1. Both queries have one similar field, which is "value" and "werks," but I need to call back "plantid." How would I do that?

Thanks! 

    3 replies

    Participating Frequently
    Aug 18, 2025 11:56 PM UTC

    Hi. If you need to display data from the "Storage Location" table that depends on the "Plant" table, the "Storage Location" table should include a field that serves as a foreign key referencing plantId in the "Plant" table.
    Please refer to this link to configure cascading dropdowns: https://docs.appian.com/suite/help/25.3/recipe-configure-cascading-dropdowns.html

    shubhama926776
    Brainy
    Aug 19, 2025 3:03 AM UTC

    Use the selected plantId to lookup its corresponding value field from plantData, then filter storageData where werks matches that value to populate the dependent Storage Location dropdown.

    a!localVariables(
      /* Sample Plant Data */
      local!plantData: {
        a!map(plantId: 1, value: "P100", description: "Plant Chicago"),
        a!map(plantId: 2, value: "P200", description: "Plant Dallas"),
        a!map(plantId: 3, value: "P300", description: "Plant Boston")
      },
      /* Sample Storage Location Data */
      local!storageData: {
        a!map(werks: "P100", name1: "Warehouse A", land1: "USA"),
        a!map(werks: "P100", name1: "Warehouse B", land1: "USA"),
        a!map(werks: "P200", name1: "Storage Unit 1", land1: "USA"),
        a!map(werks: "P200", name1: "Storage Unit 2", land1: "USA"),
        a!map(werks: "P300", name1: "Depot North", land1: "USA"),
        a!map(werks: "P300", name1: "Depot South", land1: "USA")
      },
      /* Variables to store selections */
      local!selectedPlantId: null,
      local!selectedStorageLocation: null,
      /* Get the value field of selected plant */
      local!selectedPlantValue: if(
        a!isNullOrEmpty(local!selectedPlantId),
        null,
        index(
          local!plantData.value,
          wherecontains(local!selectedPlantId, local!plantData.plantId),
          null
        )
      ),
      /* Filter storage locations based on selected plant */
      local!filteredStorageLocations: if(
        a!isNullOrEmpty(local!selectedPlantValue),
        {},
        index(
          local!storageData,
          wherecontains(local!selectedPlantValue, local!storageData.werks),
          {}
        )
      ),
      /* Form Layout */
      a!formLayout(
        titleBar: "Plant and Storage Selection",
        contents: {
          /* Plant Dropdown */
          a!dropdownField(
            label: "Plant",
            placeholder: "-- Select Plant --",
            choiceLabels: local!plantData.description,
            choiceValues: local!plantData.plantId,
            value: local!selectedPlantId,
            saveInto: {
              local!selectedPlantId,
              a!save(local!selectedStorageLocation, null)
            },
            required: true
          ),
          /* Storage Location Dropdown - FIXED */
          a!dropdownField(
            label: "Storage Location",
            placeholder: "-- Select Storage Location --",
            disabled: a!isNullOrEmpty(local!selectedPlantId),
            choiceLabels: if(
              a!isNullOrEmpty(local!filteredStorageLocations),
              {},
              local!filteredStorageLocations.name1
            ),
            choiceValues: if(
              a!isNullOrEmpty(local!filteredStorageLocations),
              {},
              local!filteredStorageLocations.name1
            ),
            value: local!selectedStorageLocation,
            saveInto: local!selectedStorageLocation,
            required: true
          )
        }
      )
    )

    शुभम्
    Participating Frequently
    Aug 19, 2025 5:33 AM UTC

    Please refer to this link to configure cascading dropdowns.

    https://docs.appian.com/suite/help/23.3/recipe-configure-cascading-dropdowns.html