This activity is used to read the content of a text file.
Similar to other activities related to reading files, an 'Assign value to variable' action block connected to this block will also appear upon adding this block to the workflow. This variable will store the contents of the read file.
However, using the 'Assign value to variable' activity is not strictly necessary in this case. It is safe to delete this block and handle the result any other way. For example, if you want to send the content of the text file in an email 'as is', i.e. without changing the content in any way then you could use the 'Send email' activity right after 'Read text file' and specify the Save the previous step result option in the Body parameter.
This activity has three parameters: File type, Path (required), and Encoding.
Speaking of File type, there are two options. You can either choose any common text tile format such as .txt, .log, .ini, and others or JSON format.
File type parameter
The Path parameter lets you define the location of the file you are going to read. As usual, it can be set manually, dynamically, or by saving the previous step result. Also, you can specify the needed file using Explorer by clicking the 'Pick' button.
This parameter allows you to specify the encoding, here is a full list of the supported ones:
Let us have a look at how the read text is represented. In this case, we used the 'Assign value to variable' action.
This is the source file we used for an example.
An example of a file to read
And this is how its contents are displayed in the variable.
The text from the file is written into this variable
A few notes about JSON format.
This is how a simple JSON file can look like in a variable.
The source JSON file
The variable with the file contents