- 04 Jan 2023
- 1 Minute to read
Getting File Data From a Document
- Updated on 04 Jan 2023
- 1 Minute to read
Users can access data from documents that have been uploaded to Decisions. This allows users the flexibility of sourcing information for Flows and Projects from a pre-existing outside source.
Below is a downloadable example to import into Decisions.
The following example will source data from an uploaded document in a folder and display it on a Form. The document used in this example is a list of airports and can be downloaded below.
- From the Designer Project, right-click the folder, click Manage, and select Get Designer Folder ID.
- Click Copy Text and click DONE.
- In the Designer Project, click CREATE FLOW to create a new Flow.
- From the Flow Designer, add a GetByFolderID step from the INTEGRATION > INTERAL SERVICES > DOCUMENTSERVICE category in the Toolbox panel.
- On the Properties panel, click Unknown next to the folder ID field and select Constant. Paste in the copied Id from the folder.
- Add a ForEach Step step from the Toolbox panel to the Get By Folder ID step by navigating to FLOW MANAGEMENT > ITERATION. On the Properties panel, click EDIT under the Collection field. Select Get By Folder ID 1_Output and click DONE.
- Add a GetDocumentData step from the INTEGRATION > INTERAL SERVICES > DOCUMENTSERVICE category in the Toolbox panel to the Next path. On the Properties panel, map Item.DocumentID to the document ID field.
- Add a Get String From Bytes step from the DATA > TEXT category of the Toolbox panel to the Get Document Data step. On the Properties panel, map GetDocumentData_Output.Contents to the Bytes field under the INPUTS category.
- Attach a Show Form step from the FAVORITE STEPS category in the Toolbox panel to the Done path of the ForEach Step and click PICK OR CREATE FORM on the Properties panel. Select CREATE, select Form, name the Form, and click CREATE.
- Configure the Form with a Text Box Multi Line component (DocumentInfo) and Button component (Done). Click Save and close the Form.
- Connect the Done path of the Get String from Bytes to the ForEach Step. Select the Form and click Unknown next to the Document Info field and select Select From Flow. Select GetStringFromBytes_Output and click DONE.
- Connect the Done path of the Form to the End step. Click Save to save changes to the Flow.
- Click Debug on the top action bar.
- Click the START DEBUGGING button. The Flow runs in the Debugger. The Form opens and the Document's data is displayed in the Rich Text Display control on the Form.