In this example, you build a Bot to enter multiple rows of data from
an XLSX sheet into a web form. Use アクション from the Excel の高度な操作, ループ, and レコーダー
パッケージ.
前提条件
Before you start building the
Bot, you can
create the following data sets on your desktop in
.xlsx format as
below.
Employee name |
Age |
Claim amount |
Claim date |
Claim type |
Mike |
30 |
469 |
22/3/2022 |
Medical |
Sarah |
34 |
766 |
28/3/2022 |
Dental |
Chris |
41 |
428 |
13/05/2022 |
Medical |
Samantha |
45 |
1000 |
09/05/2022 |
Medical |
To retrieve values from an Excel file and input them into a web form, do the
following:
手順
-
新規 Botを作成します。
-
左側のペインで [オートメーション] をクリックします。
-
をクリックします。
-
[タスク Bot を作成] ウィンドウで、Bot名を入力します。
-
次のデフォルトのフォルダーの場所をそのまま使用します。\Bots\
デフォルトのBotの保存場所を変更するには、[選択] をクリックしてプロンプトに従います。
-
[作成と編集] をクリックします。
-
Open the Excel file.
-
Double-click or drag the action.
-
Enter a session name.
-
Select the Excel file.
-
Mark the Sheet contains a header option.
By marking the Sheet contains a header option, you
enable the Bot to search for the column by the header name during
run time.
-
Launch the website.
-
Double-click or drag the
アクション.
-
Enter the website URL which consists the webform to update the
data.
-
Retrieve the worksheet values and store them in a Table variable.
-
Double-click or drag the action.
-
Enter the same session name you used in the action.
-
Select All rows from the drop-down list.
-
Create a Table variable using the icon to the right of the
Assign to variable drop-down list.
-
Instruct the Bot to process the data row by row.
-
Double-click or drag the Loop action.
-
Select the For each row in table iterator.
-
Select the same Table variable that you used in Get multiple
cells.
-
Create a Record variable using the icon to the right of the
Assign to variable drop-down list.
The Record variable holds all of the values for one row. With each iteration
of the Loop, the Bot retrieves the values of the next row and
stores them in the Record variable, overwriting the values from the previous
row.
-
Map the first column header to the web form textbox.
-
Double-click or drag the action.
-
Select the same window you opened with the Open
アクション.
-
Click Capture object.
-
Hover over the textbox until a red outline appears.
-
Click the textbox.
-
Return to the Control Room.
-
Verify that the Control Type value is
TEXTBOX.
-
Select Set text from the
Action drop-down list.
-
In the Keystrokes field, insert the same Record
variable that you used in the Loop.
-
Select the By name option and copy-paste the
first column header into the field.
-
Repeat the sub-steps in step 5 to map the other columns, with the following
differences:
-
Instead of searching for the browser window title, insert the Window
variable generated by the Recorder.
-
When inserting the Record variable in the
Keystrokes field, copy-paste the subsequent
column header into the "By name" field.
-
Capture the Submit button.
-
Double-click or drag the action.
-
Insert the Window variable generated by the Recorder.
-
Click Capture object.
-
Verify that the Control Type value is
BUTTON.
-
Select the Click action.
-
Click Save.