Understanding and using the Calculation field
Automate your calculations with the Calculation element.
Insert a calculation field and access its features: Go to the element options by clicking on the pencil.
Several options are available to you under the Properties tab:
Under the Calculation tab, you will define the fields to calculate.
The Calculation tool has several functions. Consider the following example: You want the price for an order to be automatically calculated. In the back-office. Example: Start by inserting an Input field and go to its properties: Note : To define what multiplication is, you must enter ” * ” on the keyboard. Calculation signs are performed manually on the keyboard. Once completed, confirm and save your form. Consider the example of an employee time sheet. /!\ ATTENTION /!\ Specify clearly the “numeric” type. This feature enables it to work from the outset with a Referential list, but we would prefer to use the Reference element, which was developed expressly for this feature. For those who already work with Referential lists and Calculation fields, this feature still works.. Idea: With the Referential and Calculation elements, you have the option to create a proper purchase order form. In order to obtain an identical document to your current purchase orders, you can create a Word template. Refer to the “purchase order” example, which is located in our forms library. The Uniq Number allows you to create a random line. As an example, we will use the Uniq number to create the P.O number of your Purchase Order. /!\ Don’t forget to confirm your settings and save your form. The ItemRefNum makes data reading easier. It is similar to the Reference field. It reads information contained in a given column. It is usually linked to an NFC Tag or an Input Field. To discover how to configure your NCF tag, do not hesitate to check our tutorial! You can condition your calculations through different operators: In order to perform a different calculation according to a checkbox, you can use the following formula: In the example below, we want to apply a 5% discount if our box is checked. For this, we test whether our apply 5% discount? box is checked or not. The deduction will be applied if the box is checked. In order to give a value in our calculation when an element is selected in a list, we use the following formula: In the example below, we applied it to our calculation to offer VAT if New Customer is selected. At first, we assign a code to our list, of the form code: list. This code will of course not be visible on the mobile device. We then test if our new client has been selected. Warning: if you add text, remember to remove the + which is generated automatically. In the example below, we want to achieve a grade average of 0 to 10 and not to consider an item that is not applicable. 0 In our Calculation element, we test whether the non-applicable element is entered or not. For this we use the following formulas: By repeating the first calculation for each slider element and then dividing by the second, we get the calculation below: In order to display a result when a field is equal to another field, we use the following formula: In the example below, we applied it to two input fields to check if the email addresses are identical. Warning: if you add text, remember to remove the + which is generated automatically. If you want to combine several conditions, you can use the following formula: If the first condition is false, we test the second, etc., until we reach the “Value if false” In the example below, we test our A value and B value to find out if A is greater than, less than or equal to B. We use the following formulas: Combined, we get the operation below: Warning: if you add text, remember to remove the + which is generated automatically. To perform a calculation if a box is checked or if an item is entered, you can use this formula: At first, we will test the first condition, if it turns out wrong, we will test the second, so on. In the example below, we test our input field. If it contains 0, 2, 4, 6, 8 or 10, then Even will appear, otherwise it will be Odd. Warning: if you add text, remember to remove the + which is generated automatically. Note: we could also have used the percentage (%) to perform this operation. The Percentage allows to display the rest during a division. Thus, if the number is even, the division will not have any remainder and the calculation will be equal to 0. To perform a calculation if a box is checked and an item is entered, you can use this formula: In the example below, we wish: Warning: if you add text, remember to remove the + which is generated automatically. Do not hesitate to comment on this article!
Rename it according to the needs of your form and choose the type that you need. In our example, the Entry field will be called “Price” and will be a “decimal number” type.
On the mobile.
In the back-office.
On the mobile.
Configuration.
On the mobile device.
Conditional operators
Arithmetic operators:
Comparison operators:
Logical operators:
Bitwise operators:
Examples:
In our Slider elements, we select the type Text and we add our different notes, for the Not applicable, we give it a code, -1:
1
2
3
4
5
6
7
8
9
10
-1:Not applicable
Thus, we test respectively:
All your questions, comments and suggestions are most welcome!
To facilitate your navigation and to offer you adapted and personalized content, we would like to accompany you during your visit...
Is it OK for you?
To facilitate your navigation, to offer you adapted and personalized content, we would like to accompany you during your visit...
Is it OK for you?
Post a comment