Dependent dropdown choose stores the ID in the database instead of the value that i picked

When I submit a form with a dependent dropdown fields, it stores the ID in the database...
I want to store the value or text that I chose...
HOW I DO THAT?
please help

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    You have to simply take the variable as text and pass the choice values as text which you are using in labels.

    a!localVariables(
      local!selectedDepartment,
      local!labels: {
        "Corporate",
        "Engineering",
        "Finance",
        "Human Resources",
        "Professional Services",
        "Sales"
      },
      a!sectionLayout(
        label: "Example: Cascading Dropdowns",
        contents: {
          a!dropdownField(
            label: "Department",
            choiceLabels: local!labels,
            choiceValues: local!labels,
            /*pass same as labels of whatever you want to store*/
            placeholder: "-- Select a Department -- ",
            value: local!selectedDepartment,
            saveInto: { local!selectedDepartment,  }
          ),
          
        }
      )
    )

Reply
  • 0
    Certified Lead Developer

    You have to simply take the variable as text and pass the choice values as text which you are using in labels.

    a!localVariables(
      local!selectedDepartment,
      local!labels: {
        "Corporate",
        "Engineering",
        "Finance",
        "Human Resources",
        "Professional Services",
        "Sales"
      },
      a!sectionLayout(
        label: "Example: Cascading Dropdowns",
        contents: {
          a!dropdownField(
            label: "Department",
            choiceLabels: local!labels,
            choiceValues: local!labels,
            /*pass same as labels of whatever you want to store*/
            placeholder: "-- Select a Department -- ",
            value: local!selectedDepartment,
            saveInto: { local!selectedDepartment,  }
          ),
          
        }
      )
    )

Children