In this example, you build a bot to transfer values from an Excel
spreadsheet to a database using actions from the Database, Excel advanced, and Loop
packages.
Prerequisites
Before you start building your bot, create the following:
- Create an Excel spreadsheet with the following values and save it (For example:
Test_migration_db.xlsx)
John |
Williams |
jwilliams@cmail.com |
Sam |
Li |
sam.li@xyz.org |
Carl |
Miller |
carl@carlmillerllc.com |

- Create an Access database table named
CustomerT
with the following
columns: (create a database similar to the image below and save it - for
example: save it as Test_Migration_db.accdb)
- FirstName
- LastName
- Email

Procedure
To migrate values from a spreadsheet to a table in a database, perform the
following steps:
-
Create a new bot:
-
On the left panel, click Automation.
-
Click .
-
In the Create Task Bot window, enter the bot name.
-
Accept the default folder location: \Bots\
To change the default bot storage location, click
Choose and follow the prompts.
-
Click Create and edit.
Note: The default maximum size for individual bot is 50 MB.
-
Open the spreadsheet:
-
Double-click or drag the
action .
-
Click Browse to provide the file path.

-
Select the option to open the file in
Read-write.
-
Connect to the database:
-
Double-click or drag the
action.
-
Select the User defined connection mode.

-
Select the Microsoft Access database type.
-
Click Browse to provide the file path.
-
Insert the Excel values into the database, row by row:
-
Double-click or drag the Loop
action.
-
Select the iterator.
-
Select All rows from the Loop
through drop-down.

-
In the Assign the current value to this variable, create the record
variable
rExcelCurrentRow
.
-
Drag the
action into the Loop container.
-
Enter the following SQL statement:
-
Disconnect from the database. Drag the
action below the Loop container.
-
Close the spreadsheet. Double-click or drag
action.
-
Click Save.