This activity assists the user to read the entire text from the specified text file
and stores in a “String” variable.
Technical Reference
INPUT |
FilePath: This parameter specifies to provide the “Path” of the input text file where the text needs to be read.
You can either hardcode the values in the “String” variable or pass the values as “String” datatype.
This parameter accepts values in “String” datatype. |
|
MISC |
DisplayName: Displays the name of the activity. The activity name can be customized, which aids in troubleshooting. |
|
SkipOnError: Specify the "Boolean" value as "True" or "False."
True: Continue executing the workflow regardless of any errors thrown. False: Halt the workflow if it encounters any errors. None: If the option is left blank, the activity will, by default, behave as if "False" were chosen. |
||
Version: It indicates the version of the feature being used. |
||
OUTPUT |
ReadText: It returns the output of the activity as the text extracted from the specified text file. It returns the output in “String” datatype. |
|
Result: It provides the ability to view the execution status of the activity. It returns values in "Boolean."
True: Indicates that the activity has been executed successfully without any errors. False: Indicates that the activity has been unsuccessful due to an unexpected error being thrown. |
* Represents mandatory fields to execute the workflow
Here’s an example of how the “ReadText” activity works –
In the following example, I am going to use the “Notepad” application where it
contains the IP Addresses of the company. Using the “ReadText” activity, I am
going to read and extract the text.
Steps to execute the bot:
1. Create a solution named “TextAutomation” or open an existing solution.
2. Drag and drop the "ReadText" activity onto the designer pane and set
it as the “Start Node.”
3. Double click on the activity to provide the required inputs.
a. Here I am providing the “FilePath” as the path of the text file.
4. Navigating to the “ReadText” in the output of the properties
section to declare a variable to store the extracted value.
a. There are two methods to store the spied value in the variable.
b. Method 1: Double-click on the variable parameter in the “Output”
section and enter a name that helps you easily identify it in the flow.
Here, I'm using the name "RD" and using the shortcut key "Ctrl+Q"
to create the variable.
c. Method 2: Click on the variable pane, enter your preferred name
(here, I'm using "RD"), and choose the data type as "String" since
the output value accepts the string data type.
5. You can add a write log activity next to the “ReadText” activity to
view the output.
6. Now, execute the workflow to view the results.
Below is a sample of the output of the activity.