fileupload

Hi,

i have to upload multiple files how can i achieve this without using for loop and the RI to store the files in the db

  Discussion posts and replies are publicly visible

  • One basic thing - To upload a document in Appian, it has to be uploaded in a User input task or a Process start form. So you'll anyway have to create an interface and map it in the RI. But for this, you just need a RI of document type (list) and map it as the value and save into in the file upload field. 

  • a!formLayout(
      label: "Upload File",
      contents: {
        a!sectionLayout(
          contents: {
            a!fileUploadField(
              label: "File Upload",
              instructions: "Only xlsx and csv file allowed",
              labelPosition: "ABOVE",
              target: cons!MP_UPLOADED_FILE,
              fileNames: substitute(fv!file.name, " ","_"),
              fileDescriptions: fv!file.name &" "&" uploaded",
              maxSelections: 2,
              value: ri!document,
              saveInto: {ri!document},
              required: true,
              validations: a!localVariables(
                local!invalidExtension: difference(upper(fv!files.extension),{"XLSX","CSV"}),
                {
                if(
                  local!invalidExtension>0,
                  "Attachments must be xlsx or csv. Remove: " &
                  index(fv!files, "name", wherecontains(local!invalidExtension, upper(fv!files.extension)),{}),
                  ""
                )
              }),
              buttonStyle: "SECONDARY"
            )
          }
        ),
        a!sectionLayout(
          label: "",
          contents: {}
        )
      },
      buttons: a!buttonLayout(
        primaryButtons: {
          a!buttonWidget(
            label: "Submit",
            submit: true,
            style: "PRIMARY"
          )
        },
        secondaryButtons: {
          a!buttonWidget(
            label: "Cancel",
            value: true,
            saveInto: ri!cancel,
            submit: true,
            style: "NORMAL",
            validate: false
          )
        }
      )
    )

    You can try this code, you can configure a rule input for document and make it array. The target is the constant for folder