Saving a Document to a Process Folder
  • 21 Feb 2023
  • 3 Minutes to read
  • Dark
    Light

Saving a Document to a Process Folder

  • Dark
    Light

Article Summary

Overview

Process Folders can have documents stored within them. This article will demonstrate how to configure a Flow to store and retrieve a document from a Process Folder.


Saving a Document to a Process Folder

  1. Create a Folder and give it a name. This will be used to store all Process Folders. In this example, the Folder will be named ProcessFolderData.
  2. In the Designer Project, create a new Flow.
  3. In the Flow Designer, select the Start step. On the Properties panel under Flow Input Data, click SHOW EDITOR.
  4. Under NAME enter "Input File" and change the TYPE to FileDate. Click Save and close the window.
  5. From the Toolbox, drag over the Setup Process Folder step onto the workspace and connect it to the Done path of the Start step.
  6. Set the Parent Folder to Process Folder Data. Set the Folder Name and the Folder Description.
  7. Click the Done path. Navigate to All Steps [Catalog] > Process and select the Add File step. Click ADD.
  8. Map InputFile.Contents to the Data input field. Enter "Test File" in the Name field.
  9. Connect the Done path to the End step. Click Save to save changes to the Flow. 
  10. Debug the Flow to create the Process Folder and store the file.
  11. Navigate to the Process Folder Data and select the Folder. The file should be found in that folder on the Folder Activity Panel and in the Document Header. Depending on the file type, there will be the actions to Download, Update and View the file.

Retrieving A File From A Folder Dynamically

Files stored in Folders can also be retrieved by Flows. The following example will demonstrate how to create a Flow to retrieve files from a Folder.

Prerequisites 
Navigate to the Process Data Folder and obtain its Folder Id by, right-clicking it and selecting Manage > Get Folder ID. Then copy the Folder ID.
  1. From a Designer Project, click CREATE FLOW and select Flow. Name the Flow and click CREATE. 
  2. From the Flow Designer, navigate to the INTEGRATION > INTERNAL SERVICES > DOCUMENTSERVICE category in the Toolbox and attach a GetByFolderID step to the Start step.
  3. From the Properties tab of the Get By Folder ID step, Constant map the folder ID of the Process Folder under the INPUTS category. 
  4. From Toolbox > FAVORITE STEPS, attach a Create Data step to the Done path of the Get By Folder ID step. On the Properties panel, under DATA > Data to Create, click SHOW EDITOR.
  5. From the Data to Create window, provide a NAME, select File Data from the TYPE dropdown, and check the IS LIST box. Set the INPUT to Constant, click Save, and close the window.
  6. Back in the Flow Designer, connect a ForEach Step from Toolbox >  FLOW MANAGEMENT > ITERATION to the outcome path of the Create Data step. 
  7. From the ForEach Step's Properties, map GetByFolderID1_Output.All DocumentID to Collection.  
    Mapping Input to Collection will automatically change the Type in the DATA > Type dropdown.

  8. From the same DOCUMENTSERVICE category as the Get By Folder ID step, attach a GetDocumentData step to the Next path of the ForEach Step. From the Properties panel, map Item to INPUTS > document ID
    The GetDocumentData step is used to retrieve the FileData for the designated document. 

  9. Under Toolbox > DATA > LIST attach an Add Item to List Step to the Get Document Data step. Map GetDocumentData1_Output to New Item and the Output from the Create Data step to Original List. Then, connect the Done path to the ForEach Step. Connect the Done path of the ForEach Step to the End step.
  10. Select the End step. Under Properties > DATA > Pick From Current Data, select New List.
  11. Click Save to save changes to the Flow. Click Debug then click START DEBUGGING.
  12. After the Flow runs, select the End step, then click View Execution 1 > View Output Data. The resulting Output Data represents a list of the Files contained within the Process Folder.



Was this article helpful?