Description
When dealing with unstructured data, such as quotes, it becomes increasingly difficult to know exactly which fields each different quote contains, and therefore impossible to create a process that will cater for all variances of quotes.
With the complexity in mind, the QUOTE class will handle all of the complexity for you, and allow you to focus on processing quotes easily.
Quotes in PDFs, Excel documents, Word documents and images (.jpeg, .jpg, .gif, .png) are supported.
Setting it up
{{popup:rpas/add:action=extract-quote}}
File path - required string: The path for the file. If as part of a loop, the path might be stored as {path}. Read the article abc
Variable - required string: Where the quote will be stored once processed. If you enter "quote" as an example, then you can access the fields of the quote as "{quote::general::date}".
Company - required string: The company the quotes will be addressed to. This is important, as this will determine the "to" and "from" companies. If the company is matched, then this company name will be the same as found in the "to" field.
Currency - optional option: If all quotes are in the same currency, then select the applicable currency. If you have to cater to multi-currency quotes, then keep this blank.
Language - optional option: If all quotes are in the same language, then select the applicable language. If you have to cater to multi-lingual quotes, then keep this blank.
Minimum PO number - optional string: If you expect quotes to have your Purchase Order number on them, then enter the starting range for the Purchase Order numbers here, i.e. INV400000001.
Maximum PO number - optional string: If you expect quotes to have your Purchase Order number on them, then enter the ending range for the Purchase Order numbers here, i.e. INV400999999.
Cache - required option: Caching a quote helps speed up operations when dealing with the same quote in multiple steps, or across processes. The default value is "Only if valid".
Additional fields - optional: If you wish to add fields to the quote. you may list them here. Adding a field can be done adding "general::terms", which will be accessible later as "{quote::general::terms}", if you used "quote" as your variable name. Also specify the expected data type per field to help the bot format the data correctly.
Structure
The structure in which you can access properties of a quote, is as follow:
{
"insured": {
"name": "..",
"client number": "..",
"address": "..",
"email": "..",
"id number": "..",
"vat number": "..",
"phone": ".."
},
"policy": {
"number": "..",
"inception": "yyyy-mm-dd",
"endorsement": "..",
"renewal": ".."
},
"broker": {
"company": "..",
"address": "..",
"email": "..",
"registration number": "..",
"vat number": "..",
"phone": ".."
},
"premium": {
"total": #
},
"insured items": [{
"year": #,
"make": "..",
"model": "..",
"registration number": "..",
"vin number": "..",
"engine number": "..",
"amount": #
}, {...}, {...}],
"total insured items": #,
"currency": {
"code": "..",
"name": "..",
"symbol": "..",
"tax": #
},
"file": {},
"errors": [],
"valid": boolean
}
Looping over quotes
Read the article Working with loops in RPAs to understand the basics of loops. Two possible ways include to loop over each file in a folder, or each unread email. The "Counter variable" could be set to "file", which will allow all quotes to be accessed as "{file::path}" - which could be used as the location for the quote.
Looping over quotes line items
Read the article Working with loops in RPAs to understand the basics of loops. The option you want to use will be to loop over each record from a list, using the the following parameters (examples only):
- Counter variable - required string: This is the variable where each iteration of the line items will be stored in. If you use "line-item" here, then you can access properties of the line item, in the loop, as "{line-item::before tax}".
- Variable - required string: This is where the bot will be able to find the line items to iterate over. If you stored the quote under the variable "quote", then this will be "quote::line items".
You may further filter out the line items you want to iterate over, by specifying the {tax} > 0 (if you want to iterate over line items where tax is not zero).