- 24 Jun 2022
- 2 Minutes to read
- Updated on 24 Jun 2022
- 2 Minutes to read
File references allow files to be saved in the File System rather than memory while remaining usable in the Portal. By default, uploaded files are stored in memory for fast retrieval and indexing. In most circumstances, this way of file processing works well, but when large files enter the pool, the system can be slowed down. It is better to store these files on the server’s file system and to refer to them with file references.
They are stored in a dated (MM-DD-YYYY) subfolder in C:\Program Files\Decisions\FileStorage.
There are two ways to create a File Reference in the Flow using Load From File Data or Load From Path step.
In this example prompt a user to either pick file or type the path to the file location and create File Reference to the file.
The file used in this example can be downloaded below.
Below is a downloadable example to import into Decisions.
Start in the Designer Folder and select Create Flow to create a New Flow.
Next, name the Flow and select 'Create' to proceed to the Flow Designer.
First, create a new Form for the Flow. Expand Flows, Rules, Forms and Reports > Forms[Interaction] category and select [Pick Or Create Form] step. Select 'Add' to add this step to the workspace.
The Form is designed as follows. It has a File Upload component and a Button named "Get a File Reference by File Data".
Next, it has a TextBox to let the user input a Path to the File and a Button named "Get File Reference by Path". Save and close the Form Designer to return back to the Flow Designer.
Next, for the Get File Reference For File Data outcome from the Form in the Quick Add Step dialog expand All Steps [Catalog] > Integration > File category and select Load From File Data step. Select 'Add' to add it to the workspace.
For the Get File Reference By Path outcome from the Form expand All Steps [Catalog] > Integration > File category and select Load From Path step. Select 'Add' to add it to the workspace.
Next, select Show Mapping Editor for the Load From File Data step. Map File Upload to the file input.
Next, in the same way, perform mapping for the Load From Path step, but this time use the string with the Path that the user is going to input into the Form, and map it to the step's filePath field.
Create another Form to display the results. Create a new Form using Flows, Rules, Forms and Reports > Forms[Interaction] > [Pick Or Create Form] step. The Form is designed with a Rich Text Display and a Button.
The Rich Text Display will display a TextMerge that looks as follows:
Connect the steps as shown. This completes the Flow. Select Debug from the top panel in the Flow Designer to test the Flow.
First, pick the File using Explorer and select Get File Reference By File Data. Look at the Diagram in the Debugger see that the Flow ran with no issues and it ran using Load From File Data step.
On the second run, type the Path to the File into the TextBox and select Get File Reference By Path button. The Diagram shows that this time flow ran using Load From Path step.