Getting File Data From a Document

Last Updated: 08/18/2016 Introduced in Verision:

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 get Document ID. We locate our Document in Portal, right-click it > Manage > Get Document URL.

getDocUrl

In the resulting window copy Document ID from the URL and click Ok to close the window.

copyDocId

Then, in the Designer Folder we click Create Flow on the Folder Actions Panel.

createFlow

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

nameFlow

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

getDocumentData

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.

mapGetDocIdData

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.

addGetStringFromBytes

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.

mapDataForGetString

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.

addForm

In the resulting window we Name our Form and click Create to proceed to the Form Designer.

createForm

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.

formDesign

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.

mapDataForForm

This completes our Flow. We can click Test Flow link on the top panel of the Flow Designer.

testFlow

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.

formInDebugger

The Flow runs to the End Step with no issues.

flowDebugged

Additional Resources