Using formulas
This article describes how to use the Formula field in Continia Document Capture, whether in a header or line template field.
Formulas allow you to assign constant values, or use standard operators such as +, -, *, and / to concatenate values. These values are then shown as the output of a template field – provided that the fields from which the values originate have the same data type, like number.
If you need the initials of your customer added to their invoice numbers, for example, you can create a header field with the customer’s initials (Customer Initials) as a fixed value and another field with the combined values of the Customer Initials and Invoice No. fields. That is, CUSTINIT+DOCNO.
Here's another example. If one of your vendors doesn't add the amount including VAT to their invoices, you can use the formula AMOUNTEXCLVAT+VATAMOUNT in the Amount Incl. VAT field. The Amount Incl. VAT field will then display the sum of the values in the Amount Excl. VAT and VAT Amount fields.
Hinweis
The Formula field doesn't support conditional statements, such as IF and ELSE.
To create a formula
To create a formula in Document Capture:
- Search (
) for and select Document Categories. - Click the code of the relevant document category – for example, PURCHASE – to open the document journal.
- In the document journal, select the document whose template you want to create a formula for.
- Click the three dots on the right side of the field you want to create a formula for, such as Line Posting Description.
- On the Template Field Card, edit the Formula field on the General FastTab. For example, DUEDATE + --- + DOCNO.
To use formulas in boolean-based template fields
If a template field has its data type set to Boolean, its formula can only use the values Yes or No.
To use formulas in date-based template fields
If a template field has its data type set to Date, its formula can refer to other date-based fields and, if needed, be modified via the Calculate Date (Date Formula) field. For example, the Due Date field can have its Formula set to DOCDATE and its Calculate Date (Date Formula) field set to 5D. Therefore, the document’s due date would be DOCDATE + 5D.
It's also possible to enter the terms TODAY (or the letter T) and WORKDATE (or the letter W) in date-based formulas. This inserts the current date or the specified work date, respectively, into the template field during field recognition for all documents using that template.
For example, if you enter WORKDATE in the Formula field of the template field Due Date and the work date is December 31, 2029, the Due Date field is set to 12/31/29.
To use formulas in lookup-based template fields
If a template field has its data type set to Lookup, its formula can refer to a specific value – such as an approval flow or a dimension. This value is then ‘hardcoded’ into the template, even though it’s not necessarily stated in the documents related to the template.
To use formulas in number-based template fields
If a template field has its data type set to Number, its formula can include:
- Other template fields that also have the data type set to Number
- Other constant numerical values
- Standard operators
To use formulas in text-based template fields
If a template field has its data type set to Text, its formula can include all template fields – regardless of their data type.
Fixed letters, text parts, and numbers can be directly included in formulas. Document Capture doesn't calculate the field value but instead uses the template field values in the formula. For example, to have the same purchaser code used as the value of the Our Contact field in a specific template, enter their code in the related Formula field.
Scenario
Ester would like to use a dimension field to determine an approval flow.
First, Ester adds the Approval Flow and Department header fields to the desired template. Then, she opens Template Field Card - Approval Flow and, on the General FastTab, she sets the value of its Formula field to Department.
However, Ester’s approval flow codes don’t have the same values as her departments. To solve this, Ester adds the following translations on the Field Translations FastTab of the Template Field Card - Approval Flow:
- Marketing - Rebecca
- Sales - Gary
- Purchase - Jonathan
Now, Ester’s approval flow is dynamically based on what’s selected in the Department field – and the right approver is always automatically selected in the Approval Flow field.