Purchase invoice automation with UiPath - video tutorial
Purchase invoices processing is a prime use case for intelligent automation. It is well proven within many organisations, and is shown to deliver automation rates of up to 80%! By automating the steps in the journey of an invoice, companies do not only save on repetitive tasks, but they also improve the correctness of information and speed up the payment times.
This step-by-step video tutorial takes you through building a robot that predicts and assigns general ledger (GL) codes to the incoming invoices using aito.ai and UiPath.
Jump right in, and also check out the resources below the video in this article!

What do you build with this tutorial?

The tutorial takes a simplistic view, and only focuses on one part of the purchase processing automation: predicting and assigning the GL code for each invoice based on it's details and aito.ai's prediction (that uses historic invoices as training data).
The steps your robot will complete:
  1. 1.
    Open an excel file that contains 100 new invoices as rows
  2. 2.
    Loops through each invoice row one by one
    1. 1.
      Predicts the most likely GL code using aito.ai
    2. 2.
      Checks if the prediction confidence is above or below selected threshold
    3. 3.
      Writes results back to each row in the same excel
    4. 4.
      Colours the "low confidence" predictions in red for easy review
  3. 3.
    Closes the excel workbook and writes a log line of automation rate
Here is an extract of how the completed predictions will look, once added to your source excel:\
In a real life setting the predictions like this would happen as part of the larger workflow that takes in invoices one by one from OCR or electronic invoices source, and in the end adds the invoice in to an ERP or accounting system.
This tutorial also does not cover the data input part, but uses already populated aito.ai dataset of historic invoices. In real life there is usually another robot workflow that adds invoices in to aito.ai to keep the training data up to date.

What is needed?

  • UiPath Studio. Community edition is enough, the tutorial was built with version 2020.10.2.
  • Microsoft Excel (you'll need a version that can edit files, not just view)
  • Incoming invoices file, available here:
New UiPath version available!
Please note that UiPath published a new 21.04 version of the Studio soon after this tutorial was made. There should be no reason why the tutorial would not work with the new version, but the video is made with the 2020.10.2, and no further testing with new version has been yet completed.

Copy-pasteable resources

We have included the critical parts that are hard or long to type in to your robot here as copy-pasteable text. Be extra diligent with all the quotes, things will not work if you get just one thing wrong!
aito.ai EndPoint for the HTTP call:
1
"https://public-1.api.aito.ai/api/v1/_predict"
Copied!
aito.ai x-api-keyvalue for HTTP call headers:
1
"bvss2i2dIkaWUfBCdzEO89LpxUkwO3A24hYg8MBq"
Copied!
aito.ai query for HTTP call body:
1
"{ ""from"": ""invoices-uipath"", ""where"": {""Product_Category"": """+inputProductCategory+""",""Item_Description"": """+inputItemDescription+""",""Vendor_Code"": """+inputVendorCode+""",""Inv_Amt"": { ""$numeric"" : "+inputInvAmt.ToString+ "} },""predict"": ""GL_Code"",""limit"": 1}"
Copied!

aito.ai query

Below is a clean version of aito.ai _predict query, that is explained in the video.
1
{
2
"from": "invoices-uipath",
3
"where": {
4
"Product_Category": "CLASS-1758",
5
"Item_Description": "Travel and Entertainment Miscellaneous Company Car (Field Only) Akorn Inc Ground Transportation Miscellaneous Company Car (Field Only) May-2018",
6
"Vendor_Code": "VENDOR-1065",
7
"Inv_Amt": { "$numeric" : 27.55 }
8
},
9
"predict": "GL_Code",
10
"limit": 1
11
}
Copied!
Above query results in the following prediction response from aito.ai.
1
{
2
"offset": 0,
3
"total": 9,
4
"hits": [
5
{
6
"$p": 0.9999999512520671,
7
"field": "GL_Code",
8
"feature": "GL-6050310"
9
}
10
]
11
}
Copied!
Copy link
Contents