Open navigation

Using a group to vary the number of approvers

Modified on Tue, 23 May 2023 at 09:07 AM

This article provides details about how to vary the number of approvers required in the workflow of the document. This is different to individual end users being given the right to approve a document up to a certain value which you learn about in this article

Here we describe how to dynamically vary the number of approvers based on the content of the document. For example, if the document is more than EUR 100,000 then it requires 2 approvers etc. This can be done using either a modification task or a formula with the final result being set in the Approval mode header.

This article will show you how to:

Calculate number of approvers using a formula

Calculate number of approvers using a modification task

Calculate number of approvers using a formula

This has increasingly become the most common way of working but is sometimes combined with the modification task described below to cater for specific situations. Remember that the final result must be set in the Approval mode header. However, it is possible that results will first be stored in other headers and then a formula finally decides what number to set in the Approval mode header.

When using formulas, bear in mind that formulas are evaluated in the order they are written, so if the first expression returns a result, then the formula is not further evaluated.


Example 1:

This is one of the more common formulas used in Aico journals:

=IF(automatedJournal,0,IF(OR(isRecurrence,isSplit),recurringApprovalMode,approverNumber))

This means that we first check to see if the Automated Journal header is set to true, and if it is then we set 0 in the approval mode meaning we don't require any approval. If this is false, then we check to see if either the isRecurrence or isSplit headers are set to true. If they are, we use the value stored in the recurring approval mode header, which is usually copied from the Recurrence or Split master template. If this is also false, then we fall back on the Approver Number header which, in this example, we have set using the modification task below.


Example 2:

=IF(automatedJournal,0,IF(isRecurrence,recurringApprovalMode,MAX(IF(LEN(currencyConversionRate),1,0),approverNumber)))

This works in a very similar way to Example 1, except this time we have included an additional expression to check whether the User has entered a currency conversion rate. This tells the journal to use a rate different from the one set in the ERP system. The last part of this formula says that if the journal is not automated nor a recurrence, then we will evaluate if the User has set the conversion rate, in which case we will set the greater (MAX) of either 1 approver or the Approver Number calculated by the modification task below.


Example 3:

=IF(USERATTRIBUTE(1, creatorId) = "SSC",1,IF(COMPANYATTRIBUTE( "AttributeT6",companyCode) = "SSC approval required", 2, 0))

This approach is using User and Company attributes to determine the number of approvers.  In this example, if the User attribute 1 is "SSC" then we will have 1 approver. If not then we will check the Company Attribute 6 to see if it is set with "SSC approval required", in which case it requires two approvers otherwise it will not require approval.


Calculate number of approvers using a modification task

The modification task is used to vary the number of approvers, typically based on the document amount and currency using currency group tables.

There are three tables, one for each approver number (1, 2, 3). For each approver number, there is an amount set below which they do not come into the workflow in each currency. For example, if the approver 1 amount is set at €5,000, then any journal below that amount won't require any approvers.

For approver 2, if the amount is set at €10,000, this would require two approvers above that limit and one approver between 5,000 and 10,000.

A modification task "Calculate Number of Approvers" is used to check the table based on the currency and debit sum header fields - this can be triggered from a header change or configured on another action event. The header debit sum field itself probably needs a modification task in order to calculate from the document rows so it may be that we configure the Calculate Number of Approvers on the same actions as this calculation is performed. 

There are two possible ways to configure the Calculate Number of Approvers modification task:

Directly on the approvalMode header - if you do not include the parameter resultHeaderInternalName then, when this modification task is run it will directly affect the approvalMode header and change the number of approvers.

If you have several different rules and/or formulas in place that could affect the number of approvers, then it is better to set the resultHeaderInternalName. This will then set the number of approvers in that specified header. You would then set a formula in the approvalMode header (see above section) to take the maximum of your resultHeaderInternalName and any other headers that are considering the number of approvers. For example, you might have a header which evaluates the profit centre column and if that contains profit centres 100 and 200, then 1 approver is required. However, another rule says that any document over EUR 10,000 then 2 approvers are required. Here we need to take the larger of the 2 headers into the approvalMode header.

Note: This type of functionality is most commonly set up by your implementation team during the project.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article