Getting File Data From a Document
  • Updated on 19 Feb 2016
  • 2 minutes to read
  • Print
  • Dark
    Light

Getting File Data From a Document

  • Print
  • Dark
    Light

This tutorial demonstrates how to get data from the Document entity in Decisions .
Example :
In this example we are going to get data from the Document and display it on the Form .
First, we need to getDocument ID . We locate our Document in Portal , right-click it > Manage > Get Document URL.
Capture31.png

In the resulting window copy Document ID from the URL and click OK to close the window.
2018-07-26_103949-1.png

Then, in theDesigner Folder we click Create Flow on the Folder Actions Panel.
2018-06-27_1333408.png

In the resulting window we Name the Flow and click Create to proceed to the Flow Designer.
Capture6.png

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

2018-07-26_145535-1.png

Then, with Get Document Data step selected on the workspace we define Constant documentId step Input with Document ID that we copied previously in this tutorial.
2018-07-30_112353.png

Get Document Data step returns FileData type. We can use it to create file or save the document locally. To display Document contents on the Form we need to get Text from FileData type. We add Get String From Bytes step from All Steps [Catalog] > Data > Text category.
2018-07-27_144551.png

Next, with Get String From Bytes step selected on the workspace, for the bytes Input we use Select Value Mapping type and pick Contents from GetDocumentData_Output.
2018-07-27_144809-1.png

Next to the Get String From Bytes step in our Flow we are going to add a Form to display the contents of our Document . We add Show Form step from the Favorite Steps category.
2018-07-27_150446.png

In the resulting window we Name our Form and click Create to proceed to the Form Designer.
2018-07-27_150616.png

2018-07-27_150716.png

We Design our Form as following… We use a Label component as our Form’s title, a Text Block component to display Document Data , and a Button component to close the Form . When finished we can save the Form and close Form Designer.
2018-07-27_151654.png

Back in the Flow Designer we connect our Form Step to the End Step in the Flow . Next, we select Form Step on the workspace to set up data for it. For the TextArea step Input we Select Value of the GetStringFromBytes_Output .
2018-07-27_153435.png

This completes our Flow . We can click the Debug link on the top panel of the Flow Designer .
2018-07-27_153804.png

Our Flow runs in the Debugger . The Form opens and we should be able to see Document Data displayed on the Text Block component on the Form . Click Done button on the Form .
2018-01-22_094531-1.png

The Flow runs to the End Step with no issues.

Was this article helpful?