Project 2 — Intermediate

Invoice Processing Bot (PDF se ERP tak)

AP team ko roz 200 invoices milte hain — PDF, email me. Har invoice ka data manually ERP me type karna. Is project me bot banayenge jo email se invoice nikaale, data extract kare, aur ERP entry ke liye ready kare.

⏱ 30 min• Intermediate• UiPath Studio (Community)

Project kya karega?

WHAT

Bot Outlook inbox monitor karega — "invoice" subject wale mails se PDF attachments download karega, PDF text se invoice number, date, vendor, GST number aur total amount nikaalega, aur sab ek tracking Excel me likhega. Low-confidence invoices ek review queue me jayengi.

WHEN

Accounts Payable departments me — har company ko vendors ki invoices process karni hoti hai. Ye RPA ki sabse zyada demand wali use case hai. Document Understanding (DU) projects India me tez badh rahe hain.

WHERE

BPOs, KPOs, finance shared services — invoice processing outsourcing ki duniya me RPA ka king project. Isko portfolio me rakho to AP automation roles me direct shortlist.

Business reality: Ek invoice manually process karne me 8-10 minute lagte hain (mail check, PDF open, data type, verify). 200 invoices = 30+ ghante. Bot 30 minute me kar deta hai. Company ke liye ROI isi calculation se dikhta hai — aur yahi tum interview me bologe.

Step-by-step build

Main.xaml (Sequence)
 |
 +-- Try Catch
 |    +-- Sequence: Fetch Invoices
 |    |    +-- Get Outlook Mail Messages
 |    |    |     Filter: "[SubjectContains]='invoice' AND [Unread]=true"
 |    |    |     -> dtMails
 |    |    +-- For Each  mail in dtMails
 |    |         +-- Sequence: Process One Mail
 |    |              +-- Save Attachments  mail  to  "C:\Invoices\"
 |    |              +-- For Each File: "C:\Invoices\*.pdf" -> pdfFile
 |    |                   +-- Read PDF Text  pdfFile  ->  strText
 |    |                   +-- Assign: invNo   = Regex.Match(strText,"INV-\d{6}").Value
 |    |                   +-- Assign: invDate = Regex.Match(strText,"\d{2}-\d{2}-\d{4}").Value
 |    |                   +-- Assign: total   = Regex.Match(strText,"Total[:\s]*[\d,\.]+").Value
 |    |                   +-- Assign: gst     = Regex.Match(strText,"\d{2}[A-Z]{5}\d{4}[A-Z]\d[A-Z\d][A-Z\d]").Value
 |    |                   +-- If  invNo <> ""  AND  total <> ""
 |    |                        +-- Write Row: [invNo, invDate, gst, total, "OK"]
 |    |                   +-- Else
 |    |                        +-- Write Row: [pdfFile.Name, "", "", "", "REVIEW"]
 |    |              +-- Mark mail as read
 |    +-- Catch (Exception)
 |         +-- Log Message  LogLevel.Error  ex.ToString

Regex se data nikalna

Har field ka apna pattern. Config.xlsx me rakho — vendor ke hisaab se badalna padta hai:

# Config.xlsx - Regex Patterns
Field        Pattern
InvoiceNo    INV-\d{6}
Date         \d{2}-\d{2}-\d{4}
GSTNo        \d{2}[A-Z]{5}\d{4}[A-Z]\d[A-Z\d][A-Z\d]
Total        Total[:\s]*[\d,\.]+

# UiPath me: Assign activity + Regex.Match(strText, pattern).Value
# Agar match fail = Value "" -> REVIEW row me daal do, row fail mat karo

Ye rule-based extraction hai. Agar har vendor ka template alag hai (fonts, layouts), to UiPath Document Understanding use hota hai — ML Extractor + Keyword Extractor + Form Extractor ka ensemble, jo confidence score deta hai. DU ka validation station me human approve karta hai low-confidence fields.

Error handling

# Duplicate check - Invoke Code (LINQ) ya simple loop:
If  dtTracker.AsEnumerable.Any(Function(r) r("InvoiceNo").ToString = invNo)
     +-- Log Message  LogLevel.Warning  "Duplicate: " + invNo
     +-- Continue For Each

Enterprise tips

Interview question: "Scanned/image PDF se data kaise nikaloge?" — OCR engine (IntelligentOCR / Read PDF Text with OCR). Aur "vendor templates alag hain to?" — Document Understanding: ML extractor train karo, confidence threshold set karo (0.6+ auto-pass, neeche human review), Validation Station me approval.

Exercise

Question: dd-mm-yyyy format ki date nikalne wala regex pattern batao.

Question: Document Understanding me low-confidence field ko human review ke liye kya use hota hai? (2 words max)

Common mistakes

Lesson complete?

Project ban gaya? Ab next project pe chalte hain — Web Data Extraction Bot.

Popular courses: Data Science Course in Lucknow · AI Course in Lucknow · Python Course in Lucknow · Power BI Course · Data Analytics Course