Let's now iterate through each of the columns in the row. We will associate each column with the corresponding header in Excel. These columns will then be mapped to the input fields on the RPA challenge website.
We will use the If condition and a series of Else If conditions to map the iteration counter to the headers, for example, Counter#1 to First Name, and Counter#2 to Last Name. Let's follow these steps to do that:
- We will start by adding the If action. We will check whether it is the first column that has counterstring as 1. To indicate that, let's set the properties as follows:
- Condition: String condition
- Source value: counterstring
- Operator: =
- Target value: 1
This should look like the following screenshot:
- Next, let's indicate that the first column at position 1 is First Name. To do that, add a String Assign action under the If condition and set CurrentColumnName as First Name:
- Now that we have indicated the first column in the row, let's do the same for the other columns. We will use the Else If condition to do that. For the second column, let's add an Else If action and set the properties as follows:
- Condition: String condition
- Source value: counterstring
- Operator: =
- Target value: 2
- Just below the Else If condition, let's add another String Assign operation and set CurrentColumnName as Last Name:
- Do you get the drift? Go ahead and add Else If for the rest of the five columns. Add the String Assign operation for Company Name, Role in Company, Address, Email, and Phone Number, as shown:
We now have the current column name for the iteration stored in the CurrentColumn
Name variable. We will use that name of the column to check for the corresponding RPA challenge field to enter the column data. For example, if the current column that is being iterated is Last Name, we will identify the Last Name field on the RPA challenge website.