File References
  • Updated on 08 Oct 2014
  • 3 minutes to read
  • Print
  • Dark
    Light

File References

  • Print
  • Dark
    Light

File references allow large files to be saved in the file system rather than memory, but still be 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 (DD-MM-YYYY) subfolder in C:\Program Files\Decisions\FileStorage .
75-1.png

There are two ways to create a File Reference in the Flow using Load From File Data or Load From Path step.

Example:
In our Example we will prompt user to either pick file or type the path to the file location and create File Reference to the file.
We start in the Designer Folder and click Create Flow to create a New Flow.
2018-07-03_105218-1.jpg

Next, we name our Flow and click Create to proceed to the Flow Designer.
2018-02-09_132533.png

First, we are going to create a new Form for our Flow. We expand Flows, Rules, Forms and Reports > Forms[Interaction] category and select [Pick Or Create Form] step. We click Add to add this step to our workspace.
2018-02-09_132557-2.jpg

Our Form is designed as follows. It has a File picker and a Button to get a File Reference using File Data. Next, it has a TextBox to let the user input a Path to the File and a Button to get File Reference using Path. When we are finished designing our Form we can save and close it to return back to our Flow Designer.
2018-07-05_112832-1.jpg

Next, for our Get File Reference For File Data outcome from our Form in the Quick Add Step dialog we expand All Steps [Catalog] > Integration > File category and select Load From File Data step. We click Add to add it to our workspace.
2018-07-05_114003.jpg

For our Get File Reference By Path outcome from our Form we expand All Steps [Catalog] > Integration > File category and select Load From Path step. We click Add to add it to our workspace.
2018-07-05_114132.jpg

Next, we select Show Mapping Editor for our Load From File Data step. We map File that is going to be picked by the user in our Form to the file field.
2018-07-05_115704.jpg

Next, in the same way, we perform mapping for our Load From Path step, but this time we use the string with the Path that the user is going to input into our Form , and map it to our step's filePath field.
2018-07-05_120205.jpg

We are going to create another Form to display the results. We create a new Form using Flows, Rules, Forms and Reports > Forms[Interaction] > [Pick Or Create Form] step. Our Form is designed with a TextBlock and a Button . The TextBlock will display TextMerge that looks as follow:
2018-07-05_122329.jpg

We connect our steps as shown. This completes our Flow. We can click Debug Flow from the top panel in the Flow Designer to test our Flow.
2018-07-05_122446.jpg

For our test, we are going to use next file...
2018-07-05_124243.jpg

First, we are going to pick our File using Explorer and click Get File Reference By File Data.
2018-07-05_122704.jpg

And we are getting the expected result.
2018-07-05_122808.jpg

If we look at the Diagram in our Debugger we can see that the Flow ran with no issues and it ran using Load From File Data step.
On the second run we type the Path to our File into the TextBox and click Get File Reference By Path button.
2018-07-05_124147.jpg

And the result is as expected...
2018-07-05_124108.jpg

The Diagram shows that this time flow ran using Load From Path step.
2018-07-05_124211.jpg

Was this article helpful?