Skip to main content
April 3, 2023
Question

How to Upload Multiple Files and Save file to Folder and Values to Database?

  • April 3, 2023
  • 3 replies
  • 0 views

Hi,

I have requirement like below.

I have one main Record Type( MFU TestData), in that I will store some columns,

And I have Second Record Type(MFU TestFiles), In that I will save files. and It is referencing above table. 

Can someone please help me to upload multiple files and save them to folder and save the values to database.

Please help me to write expression which stores data to main table and list of files to second table.

I am getting the following error if select the column from reference table

ri!record['recordType!MFU TestData.relationships.mfuTestfiles.fields.fileName']

3 replies

stefanhelzle0001
Brainy
April 3, 2023

You cannot write through to a related record.

I suggest to create a new rule input of type multiple document and make this the target for your file upload field.

In the process model, first write the main record and store the written data back to the process variable. Next, create an expression rule which takes the main record and the list of files. This expression loops on the files and creates a MFU TestFiles record item for each, containing the id of the document and the primary key of the main record.

Call that expression in a script task and save the output to another process variable. Then write that list to the record/database.

August 29, 2024

Hi can you pls elaborate a bit more on this stmt
" This expression loops on the files and creates a MFU TestFiles record item for each, containing the id of the document and the primary key of the main record."

stefanhelzle0001
Brainy
August 30, 2024

Use a!foreach() to create a record "for each" document.