Use the Compare component
Compare two string objects that are based on their ASCII values by using the Compare component in RPA Desktop Design Studio.
Before you begin
Role required: none
About this task
Compare method is used to compare given text with provided options. If option is matched, it opens the matching control out port.
You can configure the properties for the Compare component. For more information about these properties, see Properties of the String Utilities components.
Procedure
In the Toolbox pane, navigate to Utilities > String Utilities.
Drag the Compare component to the Design surface.
In the Compare component, double click the title bar to launch the Configuration editor.
Select the Add icon (
Image omitted: add-image-icon.png
Plus icon.\) to add the string options from the Comparison Options drop-down list.
Plus icon.\) to add the string options from the Comparison Options drop-down list.
For example, select the following options.
Image omitted: compare-options-rpa.png
Comparison options selected in the configuration window.
Comparison options selected in the configuration window.
- Connect the data and control ports of the Compare component to the corresponding ports of the other components as described in the following table.
| Name | Purpose of connection | Port type | Data type |
|---|---|---|---|
| Text | Provide text that must be compared with multiple control out ports based on the comparison type.For example, if you provide `hello welcome` as the comparison text, the component compares option 0 and option 1. Since Option 1 starts with hello, it matches with the text provided. Connect this to a MessageBox component to view the output. Image omitted: compare-text-messagebox-rpa.png Compare component with text and comparison options, after running this component, the output is displayed using MessageBox component. | Data In | String |
- To test the component, under the DESIGN tab, click Run.
Parent Topic:String utilities