Enable to return multiple values on a editableGrid

Certified Associate Developer

Basically im developing a start form where i get a list of records that contain a a docID and a dropdown. 

The interface has a editable grid where the user can add rows and per row the user can add a document (file uploadField) and a dropdown. 

My issue is that on both fields i selected the value and the save with ri!VALUE and when i add a document it makes it so that in all the rows that document is selected and the same for the dropdowns.

How can i make that per row created the save and the value creates a new array? In the interface i have already selected the ri! as multiple.  

ill leave the code here , and thanks in advance to all, 

a!localVariables(
  local!rowsTemp: a!gridRowLayout(
    contents: {
      a!fileUploadField(
        label: "Input File",
        labelPosition: "ABOVE",
        validations: {},
        target: cons!FOLDER,
        saveInto: ri!input[record.docID],
        value:local!doc,     
      ),
      a!dropdownField(
        choiceLabels: LABELS,
        choiceValues: codes,
        label: "",
        labelPosition: "ABOVE",
        placeholder: "--- Select a Value ---",
        saveInto: ri!input[record.docID],
        searchDisplay: "AUTO",
        validations: {}
      )
    }
  ),
  local!AddRow:  a!gridRowLayout(  contents: {
    a!fileUploadField(
      label: "Input File",
      labelPosition: "ABOVE",
      validations: {},
      target: cons!FOLDER,
      saveInto: ri!input[record.docID],
      value:local!doc,     
    ),
    a!dropdownField(
      choiceLabels: LABELS,
      choiceValues: codes,
      label: "",
      labelPosition: "ABOVE",
      placeholder: "--- Select a Value ---",
      saveInto: ri!input[record.docID],
      searchDisplay: "AUTO",
      validations: {}
    )
  }),
 
    a!columnsLayout(
      columns: {
        a!columnLayout(
          contents: {
            a!gridLayout(
              label: "Input Doc",
              labelPosition: "ABOVE",
              headerCells: {
                a!gridLayoutHeaderCell(label: "Input Doc"),
                a!gridLayoutHeaderCell(label: "Doc Date")
              },
              columnConfigs: {},
              rows: { local!rowsTemp },
              selectionSaveInto: {},
              addRowLink: a!dynamicLink(
                label: "Add Source",
                value: a!map(
                  id: null(),
                  document: null(),
                  sourceType: null()
                ),
                saveInto: {
                  a!save(
                    local!rowsTemp,
                    append(local!rowsTemp, local!AddRow)
                  ),
                  a!save(local!rows, local!rows + 1)
                },
                showWhen: local!rowsUnder30,
 
              ),
              validations: {},
              shadeAlternateRows: true
            )
          }
        ),
        a!columnLayout(contents: {}, width: "NARROW_PLUS")
      }
    ),
    a!buttonArrayLayout(
      buttons: {
        a!buttonWidget(
          label: "Run ",
          style: "OUTLINE"
        )
      },
      align: "END"
    )
)

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Associate Developer
    in reply to Mike Schmitt

    a!localVariables(
    
      local!rowsTemp: a!gridRowLayout(
    
        contents: {
    
          a!fileUploadField(
    
            label: "Input File",
    
            labelPosition: "ABOVE",
    
            validations: {},
    
            target: cons!FOLDER,
    
            saveInto: ri!input[record.docID],
    
            value:local!doc,     
    
          ),
    
          a!dropdownField(
    
            choiceLabels: LABELS,
    
            choiceValues: codes,
    
            label: "",
    
            labelPosition: "ABOVE",
    
            placeholder: "--- Select a Value ---",
    
            saveInto: ri!input[record.docID],
    
            searchDisplay: "AUTO",
    
            validations: {}
    
          )
    
        }
    
      ),
    
      local!AddRow:  a!gridRowLayout(  contents: {
    
        a!fileUploadField(
    
          label: "Input File",
    
          labelPosition: "ABOVE",
    
          validations: {},
    
          target: cons!FOLDER,
    
          saveInto: ri!input[record.docID],
    
          value:local!doc,     
    
        ),
    
        a!dropdownField(
    
          choiceLabels: LABELS,
    
          choiceValues: codes,
    
          label: "",
    
          labelPosition: "ABOVE",
    
          placeholder: "--- Select a Value ---",
    
          saveInto: ri!input[record.docID],
    
          searchDisplay: "AUTO",
    
          validations: {}
    
        )
    
      }),
    
     
    
        a!columnsLayout(
    
          columns: {
    
            a!columnLayout(
    
              contents: {
    
                a!gridLayout(
    
                  label: "Input Doc",
    
                  labelPosition: "ABOVE",
    
                  headerCells: {
    
                    a!gridLayoutHeaderCell(label: "Input Doc"),
    
                    a!gridLayoutHeaderCell(label: "Doc Date")
    
                  },
    
                  columnConfigs: {},
    
                  rows: { local!rowsTemp },
    
                  selectionSaveInto: {},
    
                  addRowLink: a!dynamicLink(
    
                    label: "Add Source",
    
                    value: a!map(
    
                      id: null(),
    
                      document: null(),
    
                      sourceType: null()
    
                    ),
    
                    saveInto: {
    
                      a!save(
    
                        local!rowsTemp,
    
                        append(local!rowsTemp, local!AddRow)
    
                      ),
    
                      a!save(local!rows, local!rows + 1)
    
                    },
    
                    showWhen: local!rowsUnder30,
    
     
    
                  ),
    
                  validations: {},
    
                  shadeAlternateRows: true
    
                )
    
              }
    
            ),
    
            a!columnLayout(contents: {}, width: "NARROW_PLUS")
    
          }
    
        ),
    
        a!buttonArrayLayout(
    
          buttons: {
    
            a!buttonWidget(
    
              label: "Run ",
    
              style: "OUTLINE"
    
            )
    
          },
    
          align: "END"
    
        )
    
    )

    Here it is! 

    Thanks for the tip! Its my first time asking for something in this forum! 

  • 0
    Certified Lead Developer
    in reply to baltazarC

    Cool, thanks for giving it a shot - though I was hoping you might do this conversion on the original post (by editing it), just for space-saving purposes Wink  But it's academic now, if that version is out-of-date already.