Training Objective
Participants will build a UiPath robot that reads customer data from Excel, fills in a web form, captures the Order ID, stores the Order ID in Excel, emails each customer and uploads the file to SharePoint.
Process Flow
Preparation (Step 0)
- Install UiPath Studio (Community Edition) and sign in.
- Install the UiPath Browser Extension for Chrome / Edge.
- Create a new project: Process β name it
CustomerOrderBot. - Make sure the following packages are installed (Manage Packages):
UiPath.Excel.Activities UiPath.UIAutomation.Activities UiPath.Mail.Activities UiPath.MicrosoftOffice365.Activities
- Download the sample data from the 2. Sample Data tab and save it in your project folder.
Suggested Variables
| Name | Type | Purpose |
|---|---|---|
dtCustomers | DataTable | Data from Excel |
strOrderId | String | Order ID from the form |
strExcelPath | String | Excel file path |
intCount | Int32 | Successful count |
Prepare Customer Data (Excel/CSV)
Download Customer_Sample_Data.xlsx. The file contains: Full Name, Address, Phone No, Gender, Date of Birth, Nationality, IC / Passport, Email and an empty Order ID column. Make sure all data is complete before you start.
Use Excel FileRead RangeRead CSVUse Excel File β Path: "Customer_Sample_Data.xlsx" (Reference as: Excel)
Read Range β Range: Excel.Sheet("Sheet1") Output: dtCustomers (Has headers β)
Log Message β "Total customers: " + dtCustomers.Rows.Count.ToString
Submit Data via Form
Open the 3. Input Form tab in your browser, then use Use Application/Browser. Inside For Each Row in Data Table, fill in every field and click Submit. Each element has a stable id so selectors are simple and reliable.
| Field | Element id | Activity | Value (VB.NET) |
|---|---|---|---|
| Full Name | fullName | Type Into | CurrentRow("Full Name").ToString |
| Address | address | Type Into | CurrentRow("Address").ToString |
| Phone No | phoneNo | Type Into | CurrentRow("Phone No").ToString |
| Gender | gender | Select Item | CurrentRow("Gender").ToString |
| Date of Birth | dob | Type Into | CurrentRow("Date of Birth").ToString (DD/MM/YYYY) |
| Nationality | nationality | Type Into | CurrentRow("Nationality").ToString |
| IC / Passport | icPassport | Type Into | π§© Challenge β see below |
email | Type Into | CurrentRow("Email").ToString | |
| Submit | btnSubmit | Click | β |
| Order ID | orderId | Get Text | Output β strOrderId |
| Submit Another | btnNew | Click | Return to an empty form |
| Error message | formError | Check App State | If it appears β log the error, skip the row |
π‘ Tip: For Type Into, enable Empty field before typing. Tick βSimulate slow serverβ on the form to practise Check App State / timeouts.
Use Browser Edge/Chrome β URL: (link tab Input Form)
For Each Row in Data Table (CurrentRow in dtCustomers)
Type Into 'Full Name' β CurrentRow("Full Name").ToString
... (field lain)
Select Item 'Gender' β CurrentRow("Gender").ToString
Click 'Submit'
Check App State β wait element 'orderId' appears (timeout 10s)
Get Text 'orderId' β strOrderId
Assign CurrentRow("Order ID") = strOrderId
Click 'Submit Another'
Order ID format: 12345001234_1234 (11 digits + underscore + 4 digits). Validation regex: ^\d{11}_\d{4}$
The form only accepts numbers in the IC / Passport field, but the Excel data contains dashes (e.g.
900314-14-5671) and some passports contain letters (e.g. K48201937).
Do not edit the Excel file β make the robot clean the value before typing it. Malaysian IC must end up as exactly 12 digits.
Hint 1
Look at the String methods available onCurrentRow("IC / Passport").ToString β which one can swap a character for nothing?Hint 2
Passports contain letters, not only dashes. Is there an activity or .NET class that removes every non-digit character in one go?Show answer
Dashes only:CurrentRow("IC / Passport").ToString.Replace("-","")All non-digits:
System.Text.RegularExpressions.Regex.Replace(CurrentRow("IC / Passport").ToString, "[^0-9]", "")Store Order ID in Excel
When the loop finishes, write the DataTable (which now contains the Order IDs) to a new file Customer_Order_List.xlsx.
Write RangeWrite CellUse Excel File β Path: "Customer_Order_List.xlsx" (Create if not exists β)
Write Range β Destination: Excel.Sheet("Sheet1") Source: dtCustomers (Include headers β)
Send Email to Customer
Use Send Outlook Mail Message inside the loop (or in a second loop after the Excel file is saved). Replace the Email column with your own email address when testing.
Send Outlook Mail MessageTo: CurrentRow("Email").ToString
Subject: "Your Order ID from UiPath Submission"
Body: "Dear " + CurrentRow("Full Name").ToString + "," + vbCrLf + vbCrLf +
"Thank you for your submission." + vbCrLf + vbCrLf +
"Your Order ID is: " + CurrentRow("Order ID").ToString + vbCrLf + vbCrLf +
"Please keep this Order ID for your reference." + vbCrLf + vbCrLf +
"Best regards," + vbCrLf + "UiPath Training Team"
Upload Excel to SharePoint
Manual: Sign in to SharePoint β go to the training / automation results folder β Upload Customer_Order_List.xlsx.
Automated (optional): Use Microsoft 365 activities (requires an M365 account connection / Integration Service).
Microsoft 365 Scope (or OneDrive & SharePoint connection)
Upload File β File: "Customer_Order_List.xlsx"
Destination: SharePoint site βΊ Documents βΊ UiPath Training Results
Validation
- β The Excel file on SharePoint can be opened.
- β Every customer has an Order ID (correct format).
- β Emails have been sent to all customers.
Use the 4. Submissions & Validation tab β upload Customer_Order_List.xlsx to automatically check that every Order ID is valid and exists in the form records.
Optional UiPath Enhancements
- Automate form submission using Data Scraping / Type Into.
- Automate email sending using Send Outlook Mail Message with Excel looping.
- Automate SharePoint upload using UiPath SharePoint / Microsoft 365 Activities.
- Add Try Catch + Retry Scope for failed records, and write a
Statuscolumn.
Sample Customer Data
Download the file below and save it in your UiPath project folder. The Order ID column is left empty for the robot to fill in.
Generate random data (extra practice)
For volume / looping practice, generate a random dataset in the same format.
Customer Input Data Form
Submission Log
All form submissions (stored in this browser). Use it as the βanswer keyβ to check the robotβs results.
Validate Customer_Order_List
Upload the robotβs output file (.xlsx or .csv). The Order ID column will be checked: present, correct format, and matching the submission records.
Email Preview
Select a submission to preview the email the robot should send.