What Are We Going to Build?
In this tutorial you will build a UiPath bot that does three things:
- Reads data from an Excel file (a list of invoices)
- Filters the invoices that are past due
- Sends an automatic reminder email to the relevant vendor
This is the most common automation scenario in Indonesian companies — and it can be finished in 30 minutes if you follow the steps below.
Before You Start
Make sure you already have:
- UiPath Studio Community Edition installed (see the installation walkthrough in "A Complete UiPath Guide for Beginners")
- A sample Excel file with the columns:
Invoice No,Vendor,Vendor Email,Amount,Due Date - An email account for testing (Gmail or Outlook)
If you do not have a sample Excel file yet, create invoice_sample.xlsx with the following dummy data:
| Invoice No | Vendor | Vendor Email | Amount | Due Date |
|---|---|---|---|---|
| INV-001 | PT Maju Jaya | finance@majujaya.co.id | 15000000 | 2026-04-01 |
| INV-002 | CV Berkah Mandiri | ap@berkahmandiri.com | 8500000 | 2026-05-15 |
| INV-003 | PT Sentosa Abadi | billing@sentosa.id | 22000000 | 2026-03-20 |
Step 1: Create a New Project
- Open UiPath Studio
- Click New Project → Process
- Name it:
InvoiceReminderBot - Choose the language: VB.NET (default)
- Click Create
UiPath creates the project with a Main.xaml file — this is your bot's main workflow.
Step 2: Read the Excel Data
- In the Activities panel, find "Excel Process Scope" and drag it onto the Designer
- Inside Excel Process Scope, drag in a "Use Excel File" activity
- For the Excel File property, browse to
invoice_sample.xlsx - Set the reference name to:
InvoiceFile - Inside Use Excel File, drag in a "Read Range" activity
- Set the properties:
- Sheet name:
"Sheet1" - Range: leave empty (read all data)
- Output → Save to: create a new variable
dtInvoice(type DataTable)
- Sheet name:
The dtInvoice variable now holds all the data from your spreadsheet.
Step 3: Filter the Overdue Invoices
- After Read Range, drag in a "For Each Row in DataTable" activity
- Set the input DataTable to
dtInvoice - Inside the loop, drag in an "If" activity
- For the Condition, enter:
DateTime.Parse(CurrentRow("Due Date").ToString) < DateTime.Now
This condition checks whether the due date has already passed. If it has (Then), we send a reminder email.
Step 4: Send the Reminder Email
- In the Then branch of the If, drag in a "Send SMTP Mail Message" activity
- Configure these properties:
- Host:
"smtp.gmail.com"(for Gmail) or"smtp.office365.com"(for Outlook) - Port:
587 - Email: your sender address
- Password: an App Password (not your normal password — create one in Google Account Settings)
- To:
CurrentRow("Vendor Email").ToString - Subject:
"Reminder: Invoice " + CurrentRow("Invoice No").ToString + " Is Overdue" - Body:
"Dear " + CurrentRow("Vendor").ToString + ", This is a courtesy reminder that invoice number " + CurrentRow("Invoice No").ToString + " for IDR " + CurrentRow("Amount").ToString + " has passed its due date. Please arrange payment at your earliest convenience. Thank you."
- Host:
Step 5: Add Logging
Best practice: always add logging so you know what the bot did.
- Before Send Mail, drag in a "Log Message" activity
- Set the Level to Info
- Set the Message to:
"Sending reminder to " + CurrentRow("Vendor").ToString + " (" + CurrentRow("Vendor Email").ToString + ")" - In the Else branch of the If, add a Log Message:
"Invoice " + CurrentRow("Invoice No").ToString + " is not yet due — skipping"
Step 6: Run the Bot
- Make sure the Excel file is not open in another application
- Press F5 or click Run
- Watch the Output panel — you will see a log line for every invoice processed
- Check the vendor inbox (use your own test address while experimenting)
Improving the Bot: Ideas to Build On
This basic bot can be taken much further:
- Add an HTML email template — Use Send SMTP Mail with IsBodyHtml = True
- Produce a summary report — Write the run results (how many emails sent, how many failed) to a separate Excel file
- Schedule the bot — Run it automatically at 8am daily using Windows Task Scheduler or UiPath Orchestrator
- Error handling — Add a Try-Catch to deal with emails that fail to send
- Config file — Move the SMTP settings, file paths, and email template into a separate configuration file
Where to Go Next
This tutorial gives you the foundation of automation with UiPath. To master more complex scenarios — SAP GUI automation, web scraping, and Document Understanding — take the UiPath RPA Developer Foundation course from Frans Training. Over 3 intensive days you will build 5+ bots with direct guidance from certified RPA practitioners.
FAQ
Why is the email not sending?
The most common causes: (1) Gmail is blocking "less secure apps" — use an App Password rather than your normal password, (2) the wrong port — make sure you are using port 587 with TLS, (3) a corporate firewall is blocking SMTP — contact your IT team.
Can I use a CSV file instead of Excel?
Yes. Use the "Read CSV" activity in place of Excel Process Scope + Read Range. Everything else stays the same.
What if the Excel data is very large (10,000+ rows)?
UiPath handles 10,000+ rows without difficulty. For best performance, use the "Filter DataTable" activity before the loop, so the bot only processes overdue invoices instead of iterating every row.