AddFormFileAttachments Step

Use this step to add file attachments to a form instance.

Last published at: September 11th, 2024

Description:

This step adds file attachment to a form instance. 

 

Inputs

  • Name - Step Name
  • formInstanceID-- Variable/Global/Form Variable to hold the form instance ID       
  • formDefID—Select form definition   
  • fileFieldMappings —Mapping of file Control ID to upload
  • ignoreNotFoundFiles - Ignore not found files. Select (Yes/No)
 

 

Returns

  • True – file uploaded successfully
  • False - file not uploaded 
 

 

Usage:

In this sample workflow, the user submits a form with a file attachment. Next, the “addFormFileAttachment” step adds a different file during runtime. The  “getFileAttachments” step fetches all the file attachments for this specific form instance ID. The form is routed again to the user to view all the file attachments before submission.  


 

Example:

Let's build and execute the “addFormFileAttachmentsDef” example. 

  • Create a new form definition called “FileAttachmentForm". Drag and arrange the form controls as below. This example form contains labels, textarea, attach files, and submit button form controls arranged with a bootstrap grid control.  

 

  • Create a new process definition called “addFormFileAttachmentsDef”
  • Select the definition and click the “design” button
  • Drag the above process steps to the canvas and connect them as shown
  • Click the “routeForm” step to configure its “Settings” properties. Provide a name to the step.  Provide a task description. Select a form definition from the drop-down list. Provide a variable/global to hold the form instance ID. 

 

  • Click the “routeForm” step to configure its “Advanced” properties. Provide a task description. Click on the button to configure the users to route the form. Click the button to configure the application role users to route the form. Select task priority from the drop-down list. Provide the task completion duration using the UI fields. 

 

  • Click the “addFormFileAttachments” step to configure its “Settings” properties. Configure the variable.formID to hold the form instance. 

 

  • Click the “addFormFileAttachments” step to configure its “Advanced” properties. Select the form definition in the dropdown list. Map the file list to the file Control ID to upload during process run time.  Provide the file path information on the application server as below. This file is attached to the form instance during the runtime by the “addFormFileAttachments” step. 

 

  • Use the "getFileAttachments" step to fetch all the file attachments from the form instance to confirm the “addFormFileAttachments” step. Click the “getFileAttachments” step to configure its “Settings” properties. Provide a name to the step. Provide a variable/global reference to hold the Form Instance ID. Provide a variable/global reference to store the file attachments path. Provide a variable/global reference to store the file attachment names.  

 

  • Click the “getFileAttachments” step to configure its “Settings” properties. Select the form definition in the dropdown list. Click the button to map the file list to the file Control ID to upload during process run time.

 

  • Click the button to map the file list to the file Control ID to upload during process run time.

 

  • Save the process definition, create a new instance, and execute. 
  • The routeForm step routes the form to the user. In this example, the user attaches a file and submits the form. 

 

  • The "addFormFileAttachment" step shall add the file list to the form instance. The file list is fetched using the "getfileattachments" step. 

 

  • The “routeForm” step routes the form again to the user. In this example, a new file is added to the form instance, as shown below. 


     

Definition Sample:

You may download the sample definition from the link here and later import it (drag-drop) to your FlowWright Process (XML) and Form Definition (HTML) page. After import, you will need to verify the steps for the process and complete the database configuration if any. 

https://github.com/FlowWrightCode/FW10Steps/blob/main/AddFormFileAttachmentsDef.xml 

https://github.com/FlowWrightCode/FW10Steps/blob/main/FileAttachmentForm.html