Reading Text Files from a File System

Last Updated: 05/02/2018 Introduced in Version: 2.0

The Read Text File component reads and outputs the contents of a file as plain text.

To add it to a flow within the Flow Designer, go to the Toolbox panel, expand the category Integration > File and then, drag a Read Text File component to the workspace.

Example

This example begins with the assumption that our file system contains a text file called Sample Text File.

The example flow will read this file and display its content inside of a form field. The form, Read Simple Text File, already exists, and is simply configured with a Text Box Multi Line form control, label, and a button:
 
readfiledocument 
The first step in our flow will be the Read Text File component.

In the Flow Designer Quick Add window, go to Integrations > All Integrations > File, select a Read Text File component. Click Add to add it to the workspace. 

readtextfile

The next step in our flow will be the form we use to display our file contents – Display Sample Text File Form – which is in the Toolbox panel, under the category Forms [Interaction] > [Current Folder].

addform

Next, configure Read Text File by selecting it and clicking the Edit Input Mappings link on the Actions Toolbar.

Our example flow requires that Read Text File should read the file C:\SampleTextFile.txt, so give the input file Name a mapping type of Constant and a value of the path and file name. With that done, we can click OK to close the Mapping Editor.

readfileinputmapping

Configure Display Employee Status Report by selecting it and clicking the Edit Input Mapping link in the Actions Toolbar.

editinputmapping

Our example flow requires that Display Sample Text File Form should display the file contents provided by Read Text File step. Therefore we will map the output ReadTextFile_Output to our form’s input FileData. Click OK to close the Mapping Editor. Click the Debug Flow link to test the flow.

forminputmapping

In the debugger, we’re presented with a form with one field containing data from our text file.

debuggingtheflow

Additional Resources