Skip to main content
June 21, 2021
Solved

how do i upload multiple files and eventually download it after submitting in the summary interface

  • June 21, 2021
  • 1 reply
  • 0 views

HI,

I have the code below but only one file upload is allowed. How do I make it multiple upload?

a!fileUploadField(
  label: "Attachments",
  labelPosition: "ABOVE",
  target: cons!Electronic_File_Checklist_Document_Folder,
  maxSelections: 5,
  value: ri!Electronic_File_Processing.attachment1,
  saveInto: ri!Electronic_File_Processing.attachment1,
  validations: {}
)

Thanks in advance

Neil

    Best answer by mikes0011

    If your save target, ri!Electronic_File_Processing.attachment1, is not set up to handle an array of document IDs (which i'm guessing it isn't), uploading multiple files will not work.

    Generally I'd suggest an approach where you instead have the upload field save into a separate variable i.e. ri!fileUploadList, where the type is document and it's set as an array.  Then afterwards in your process model you can handle mapping these ids to different members of a CDT array, particularly if you're faced with the task of creating a new/blank row in that CDT for each document that was uploaded.

    1 reply

    mikes0011
    mikes0011Answer
    Brainy
    June 21, 2021

    If your save target, ri!Electronic_File_Processing.attachment1, is not set up to handle an array of document IDs (which i'm guessing it isn't), uploading multiple files will not work.

    Generally I'd suggest an approach where you instead have the upload field save into a separate variable i.e. ri!fileUploadList, where the type is document and it's set as an array.  Then afterwards in your process model you can handle mapping these ids to different members of a CDT array, particularly if you're faced with the task of creating a new/blank row in that CDT for each document that was uploaded.

    The Expression Guru