multi dropdown in a grid

The below code is throwing the above error. Please advise a correct way of doing this. using a dropdown column in a Grid. Grid rows are in a foreach loop and dropdown saveinto has another nested foreach loop and how to map the rights values to be able to change the preselected values and save.

rows: a!forEach(
          items: local!sources,
          expression: {
            a!gridRowLayout(
              id: fv!index,
              contents: {
                a!textField(
                  value: local!sources[fv!index].DisplayName,
                  saveInto: local!sources[fv!index].DisplayName,
                  refreshafter: "UNFOCUS"
                ),
                a!textField(
                  value: local!sources[fv!index].FullName,
                  saveInto: local!sources[fv!index].FullName,
                  refreshafter: "UNFOCUS"
                ),
                a!textField(
                  value: local!sources[fv!index].Description,
                  saveInto: local!sources[fv!index].Description,
                  refreshafter: "UNFOCUS"
                ),
                a!multipleDropdownField(
                  label: "",
                  choiceLabels: local!sources[fv!index].Technologies.Name,
                  choiceValues: local!sources[fv!index].Technologies.Id,
                  value: { local!sources[fv!index].Technologies.Id },
                  saveInto:                         a!save(
                          local!sources[fv!index].Technologies,
                          a!forEach(
                            items: save!value,
                            expression: {
                              Id: fv!index,
                              DisplayValue: displayvalue(
                                fv!index,
                                local!sources[fv!item].Technologies.Id,
                                local!sources[fv!item].Technologies.Name,
                                null
                              )
                            }
                          )
                        )
                ),

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hi

    as per your code I think you are trying to save Technologies.Name associated with selected Technologies.Id.

    to do so

    don't use second loop since you are saving at index,

    a!save(local!sources[fv!index].Technologies, local!sources[fv!index].Technologies.Name)

    or you can use apply function

    a!save(

                              local!sources.Technologies,

    apply(displayvalue(

                                    _,

                                    local!sources[fv!item].Technologies.Id,

                                    local!sources[fv!item].Technologies.Name,

                                    null

                                  ),save!value

    )

Reply
  • 0
    Certified Senior Developer

    Hi

    as per your code I think you are trying to save Technologies.Name associated with selected Technologies.Id.

    to do so

    don't use second loop since you are saving at index,

    a!save(local!sources[fv!index].Technologies, local!sources[fv!index].Technologies.Name)

    or you can use apply function

    a!save(

                              local!sources.Technologies,

    apply(displayvalue(

                                    _,

                                    local!sources[fv!item].Technologies.Id,

                                    local!sources[fv!item].Technologies.Name,

                                    null

                                  ),save!value

    )

Children
No Data