Skip to main content
January 17, 2024
Solved

MultipleDropdownField

  • January 17, 2024
  • 29 replies
  • 0 views

Hii,

In my case i have to edit the multiple Dropdown field value:

  • My value is Record type. Eg: [ "Product 1,Product 2"]
  • Choice value  is Array. Eg: ["Product 1","Product 2","Product 3"]

the value from my record type is like  :  "Product 1,Product 2".

So, value is not matching with choice value. How to resolve this, I tried converting the value to list of text using split but still it is not working.

Best answer by amaans4178

use ";" in split , try this -> 

a!localVariables(
  local!value:"Option 1;Option 2";
  local!splitedValue: split(local!value,";"),
  {
    a!multipleDropdownField(
      choiceLabels: { "Option 1", "Option 2", "Option 3" },
      choiceValues: { "Option 1", "Option 2", "Option 3" },
      value: local!splitedValue,
      label: "Multiple Dropdown",
      labelPosition: "ABOVE",
      saveInto: {local!splitedValue},
      searchDisplay: "AUTO",
      validations: {}
    )
  }
)

29 replies

jayaprakashr0001
January 17, 2024

Hi antogladvinj3315,

You are storing the data in a single text format. For the dropdown values it has to be list of array items. Try this code it will help.

a!localVariables(
  local!data:"Product 1,Product 2",
  local!DropDownData:split(local!data,","),
  a!multipleDropdownField(
    label: "Dropdown",
    placeholder: "Select",
    choiceLabels: {"Product 1","Product 2","Product 3"},
    choiceValues: {"Product 1","Product 2","Product 3"},
    value: local!DropDownData,
    saveInto: local!DropDownData
  )
)

January 17, 2024

Thanks for your response, It didn't Work,

a!localvariable(

local!Record:ri!record['recordType!{65daf38b-046b-457b-930c-521bbccdc1d0}PP Type.fields.{263d05f5-db7e-469f-b4bc-f41ee5d40137}primaryproduct'],

local!Split: Split(local!Record,";"),

)

Value:  

local!Record - "Product 11; Product 10"(Text)

local!Split - 

"Product 11"(Text)

      " Product 10"(Text)

      Used as value in multiple dropdown, but same issue

      jayaprakashr0001
      January 17, 2024

      Can you paste the code using Insert-->Code and Can you send the error screenshot it will be helpful

      January 17, 2024

      Hi [mention:5f145ed4ec2c4ba48a9ab6c61304dfa7:e9ed411860ed4f2ba0265705b8793d05] 

      Please try the below code

      a!localVariables(
        local!selected,
        local!test,
        a!multipleDropdownField(
          label: "test",
          placeholder: "--- Please select ---",
          choiceLabels: { "test1", "test2" },
          choiceValues: { 1, 2 },
          value: local!selected,
          saveInto: {
            local!selected,
            a!save(
              local!test,
              joinarray(save!value, ",")
            )
          }
        )
      )

      harshitb6843
      January 17, 2024

      Just split the value on ","

      January 17, 2024

      Thanks You for replying

      rajnis1428
      October 31, 2024

      Hi [mention:5f145ed4ec2c4ba48a9ab6c61304dfa7:e9ed411860ed4f2ba0265705b8793d05] ,

      Is this your issue is resolved? If yes then  please describe how to resolve??

      Thank you