how to add multiple documents at the same time in editable grid

Certified Associate Developer

hi team,

how to add the multiple documents at the same time to record 

could you please suggest me.

thanks

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hi  ,

    You can try the code below and let me know whether it works.

    {
      a!gridLayout(
        label: "Editable Grid",
        labelPosition: "ABOVE",
        headerCells: {
          a!gridLayoutHeaderCell(label: "Document")
        },
        columnConfigs: {},
        rows: {
          a!forEach(
            items: ri!documentIds,
            expression: a!gridRowLayout(
              contents: {
                a!fileUploadField(
                  placeholder: "upload files",
                  target: cons!FOLDER,
                  value: reject(
                    fn!isnull,
                    tointeger(split(ri!documentIds[fv!index], ";"))
                  ),
                  maxSelections: cons!MAX_SELECTIONS,
                  saveInto: {
                    a!save(
                      ri!documentIds[fv!index],
                      tointeger(save!value)
                    )
                  },
                  buttonDisplay: "LABEL"
                )
              }
            )
          )
        },
        selectionSaveInto: {},
        validations: {},
        shadeAlternateRows: true,
        addRowLink: a!dynamicLink(
          label: "Add",
          saveInto: {
            a!save(
              ri!documentIds,
              append(ri!documentIds, null())
            )
          }
        )
      )
    }

    documentIds is a list of text string. In the process model, you can split the each index and iterate through each value individually

Reply
  • 0
    Certified Senior Developer

    Hi  ,

    You can try the code below and let me know whether it works.

    {
      a!gridLayout(
        label: "Editable Grid",
        labelPosition: "ABOVE",
        headerCells: {
          a!gridLayoutHeaderCell(label: "Document")
        },
        columnConfigs: {},
        rows: {
          a!forEach(
            items: ri!documentIds,
            expression: a!gridRowLayout(
              contents: {
                a!fileUploadField(
                  placeholder: "upload files",
                  target: cons!FOLDER,
                  value: reject(
                    fn!isnull,
                    tointeger(split(ri!documentIds[fv!index], ";"))
                  ),
                  maxSelections: cons!MAX_SELECTIONS,
                  saveInto: {
                    a!save(
                      ri!documentIds[fv!index],
                      tointeger(save!value)
                    )
                  },
                  buttonDisplay: "LABEL"
                )
              }
            )
          )
        },
        selectionSaveInto: {},
        validations: {},
        shadeAlternateRows: true,
        addRowLink: a!dynamicLink(
          label: "Add",
          saveInto: {
            a!save(
              ri!documentIds,
              append(ri!documentIds, null())
            )
          }
        )
      )
    }

    documentIds is a list of text string. In the process model, you can split the each index and iterate through each value individually

Children
No Data