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 Reply Children
  • 0
    Certified Senior Developer
    in reply to anushas0002
    could you share value of local!sources ?
  • There are two tables sources and technologies with many to many relationship. Therefore, Each Source has more than one technologies in this grid which needs to be shown as preselected values. sample data is below but its lengthy. Please refer to the above another screenshot which shows error message on Editable Grid when tried to click on "Add New Source(s)" link and it is same error when I try to change the preselected values in multi dropdown.

     



    Sources
    Id: 2
    DisplayName: "Artificial Intelligence"
    FullName: "Artificial Intelligence"
    Description: "Artificial Intelligence"
    Technologies: List of Technologies: 2 items
    Technologies
    Id: 18
    Name: "Quantum Computing"
    Definition: null (Text)
    Description: null (Text)
    YearsToImpact: 10
    ScaleOfImpact: "High"
    AnalystReports: null (Text)
    AssetsAndAccelerators: null (Text)
    Standards: null (Text)
    Enablers: null (Text)
    UserCases: null (List of UseCases)
    RisksAndControls: null (List of RisksOrControls)
    CaseStudies: null (Text)
    GlobalCapabilities: null (List of Capabilities)
    Industry: null (Text)
    Vendor: null (Text)
    TeamSize: null (Number (Integer))
    OpportunityRating: 5
    RiskRating: 4
    Source: List of Sources: 1 item
    null (Sources)
    Images: List of Images: 2 items
    Images
    Id: 4
    Title: "QC_1"
    Label: "Flagships, Connected Enterprise, AI, Machine Learning, Cryptography, Encrytion, Pattern Matching"
    DocumentId: 17064
    ContentUrl: null (Text)
    Industry: null (Text)
    Source: null (Sources)
    Images
    Id: 5
    Title: "QC_2"
    Label: "Flagships, Connected Enterprise, AI, Machine Learning, Cryptography, Encrytion, Pattern Matching"
    DocumentId: 17065
    ContentUrl: null (Text)
    Industry: null (Text)
    Source: null (Sources)

  • 0
    Certified Senior Developer
    in reply to anushas0002
    Are you getting data from service ?
    because Appian do not support multiple to multiple

    you can try
    comment code and pass rows as rows:{}
    take another textField(label:debug, value: local!sources ) to display local!sources value in your interface.

    then check loacal!sources value and share it.
  • service is fine and showing the dropdown and values in another form correctly where there is no editable grid and just form with multidropdown. It is not working inside EditableGrid.