Skip to main content
Known Participant
Jun 21, 2021 3:54 PM UTC
Solved

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

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

    mikes0011
    mikes0011Answer
    Brainy
    Jun 21, 2021 4:09 PM UTC

    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

    1 reply

    mikes0011
    mikes0011Answer
    Brainy
    Jun 21, 2021 4:09 PM UTC

    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