Getting File Data From a Document
  • 08 Apr 2020
  • 2 Minutes to read
  • Dark
    Light
  This documentation version is deprecated, please click here for the latest version.

Getting File Data From a Document

  • Dark
    Light

Article summary

Overview

In Decisions, there are steps that allow a user to use the data within a document that has been uploaded in Decisions and have it available in the flow engine. The following example will show you how to take a text file and use a Flow step to extract the contents and put it on a Form.

Example

In this example get data from a Document and display it on a Form. The document used in this example is a list of airports and can be downloaded below.

   Airports.txt  

Below is a downloadable example to import into Decisions.



To begin, locate the document in the Portal, right-click and select Manage > Get Document ID.

2019-09-25_095800.png

In the resulting window select Copy Text and select 'Done' to close the window.

2019-09-25_095832.png

Then, in the Designer Folder select Create Flow in the bottom action panel.

2018-06-27_1333408.png

In the resulting dialog, name the Flow and select 'Create' to proceed to the Flow Designer.

Capture6.png

In the Flow Designer, add GetDocumentData step from Integrations > All Integrations > Internal Services > Document Service category.

2018-07-26_145535-1.png

Then, select the Get Document Data step. In the Properties panel under Inputs define a constant document ID. Paste the Document ID that was copied earlier.
2018-07-30_112353.png

Get Document Data step returns a FileData type. To display the document contents on the Form, get the text from a FileData type.

Add a Get String From Bytes step from All Steps [Catalog] > Data > Text category.

2018-07-27_144551.png

Next, select the Get String From Bytes step. In the Properties panel under Inputs choose Select from Flow as the mapping type, then pick GetDocumentData_Output.Contents.

2019-09-25-104735.png

Next to the Get String From Bytes step, add a Show Form step to display the contents of the Document.

2018-07-27_150446.png

In the resulting dialog name the Form and select 'Create' to proceed to the Form Designer.

2019-09-25_104732.png

Design the Form as follows: add a Rich Text Display control to display the file data, name the Input Data Name "Airports", then add a Button control to close the Form. When finished save the Form and close Form Designer.

To learn more about creating forms navigate here.

2019-09-25_102335.png

Back in the Flow Designer connect the Show Form step to the End step in the Flow.

Select the Show Form step on the workspace to set up data for it. For the Form's Rich Text Display control Input chose Select from Flow as the mapping type the choose the GetStringFromBytes_Output.

2019-09-25_105406.png

This completes the Flow. Select Debug in the top panel of the Flow Designer.

2018-07-27_153804.png

The Flow runs in the Debugger. The Form opens and the document data is displayed in the Rich Text Display control on the Form. Select the Done button on the Form to close.

2019-09-25_102411.png



Was this article helpful?