Overview
Data enrichment refers to the process of adding additional data above the extraction data. You can add this enrichment data from a master database.
You can validate and update the enrichment data in the portal on the Eyeball page.
For details, see this article.
Prerequisites
Make sure you have enrichment.yaml and InvoiceLineItem-invoice-enrichment.yaml configuration files defined in the system.
Configuration
The predefined configuration in yaml files define the criteria for deciding from where and which data is fetched for enrichment. The two sources to take data from can be the side-car or a master data.
Template
enrichment.yaml
kind: document metadata: name: extraction/v1/document-classification spec: nodes: - if: true then: name: Creation_Date value: ': @Creation_Date' - if: true then: name: Image_Name value: ': @Image_Name +".pdf"' - if: true then: name: OCR_Id value: ': ToString(ToGuid(wf.Variables["transactionGuid"]))' - if: true then: name: OCR_Index_Date_Time value: ': wf.CreatedAt' - if: true then: name: currency value: USD - if: 'it["TotalTax"].Value == null' then: name: TotalTax value: 0 - if: true then: name: OpcoCode value: ':@Data.Query("GetOpCoFromAddress", new object[] { ToString(it["BillingAddress"]?.Value), ToString(it["ShippingAddress"]?.Value), ToString(it["soldToAddress"]?.Value), ToString(it["CustomerAddress"]?.Value) }).opco_code' - if: true then: name: VendorUpdateRequired value: false - if: ':!string.IsNullOrWhiteSpace(it["InvoiceId"]?.Value?.ToString())' then: name: InvoiceId value: ':Join(it["InvoiceId"]?.Value?.ToString().ToCharArray().Where(char.IsLetterOrDigit(it)), "")'
Parameter | Description |
---|---|
If then | The condition to execute the rule for enrichment. |
For example, in the above template:
- If there is an OCR_Id field then the value for the field will be the workflow variable named “transactionGuid”.
- If there is a currency field then the currency value is set to USD.
- if: true then: name: OCR_Id value: ': ToString(ToGuid(wf.Variables["transactionGuid"]))'
- the extraction returns null if it can’t find content of a field, so while enrichment the system replaces null to 0.
In the example below, since the total tax value is ‘null’, so it is replaced and the total tax value after enrichment is 0.
- if: 'it["TotalTax"].Value == null' then: name: TotalTax value: 0
InvoiceLineItem-invoice-enrichment.yaml
- if: true then: name: LineItemNumber value: ': @Index'
For example, in the above configuration, if the enrichment is enabled then the value of the LineItemNumber field will be the running number for each line item in the system.