Introduction
English |
---|
Calculation Field allows you to perform a series of arithmetic computations to a set or a series of fields. The Calculation Field is only available on Professional and Enterprise Edition. |
Get Started
The easiest way to see how the Advanced Grid works is to use the existing built-in App Expenses Claims and look at an existing form in the app. Here are the steps:
- Start the Joget Server and open the App Center.
- Log in as admin and click on the pencil icon on the Expenses Claim to open the Design App. (see Figure 1)
Image Removed
Image Added
Figure 1
- Under FORMS Form Builder column, click on Expense Claim Form (see Figure 2)
Figure 2
- Hover Click on the mouse over the Calculation Field labeled labelled Total Amount $ on the canvas and click on it to to open up the Edit Configure Calculation Field properties.
- Take note of the Variables field. The The spECD value is referring to another field within the form (see Figure 3).
Image Removed
Image Added
Figure 3
- Click on the Grid element to open up the Edit Grid properties (see Figure 4).
Image Removed
Image Added
Figure 4
In Figure 5, we are summing at a specific column from a Form Grid.
Form Grid ID: spECD
Column in Form Grid: amount
Field ID to be filled in Figure 6: spECD.amount
Image Removed
Image Added
Figure 5
Image Removed
Image Added
Figure 6
- Click on Preview and enter values into the Amount column in the Grid to see the Total Amount $ automatically adds the values.
Calculation Field Properties
Edit Calculation Field
Image RemovedImage Added
Name | Description |
---|
Label | Element Label to be displayed to end user. |
ID | Element ID (By declaring as "total", a corresponding database table column "c_total" will be created) Please see Form Element for more information about defining the ID and list of reserved IDs. | Label | Element Label to be displayed to end user . |
Variables | Name | Description |
---|
Variable Name | Declare a name to store the current row equation result. Info |
---|
| - subtotal
- discountPercent
- charges
|
| Field ID | Form Field ID to retrieve. If you are | totaling totalling a form grid column, use this format: | formGridId.columnId where the first part before the decimal tells Joget which form grid to use and the second part after the decimal tells Joget which column is the specified form grid to use for calculation. | Multivalue Operation | |
|
Equation | Arithmetic operation using the variables declared above. Info |
---|
| - subtotal - (subtotal * discountPercent / 100)
- subtotal - discountAmount
- subtotal - charges (Correct)
- subtotal-charges (Wrong)
|
Info |
---|
| - It is important essential to include spacing in between operators.
- The position and spacing of all elements of an equation must be exactly as they are to appear in printed form.
|
|
Advanced Options
Data & Validation
Name | Description |
---|
Validator | Attach a Form Validator plugin to validate the input value. Info |
---|
title | When will validation takes place? |
---|
| Validation will takes place whenever form is submitted except when it is submitted as "Save as Draft". |
|
Format
Image Modified
Name | Description |
---|
Formatting Style | - US Style Formatting (1,000.00)
- European Formatting (1.000,00)
|
Number of Decimal | Number of Decimal |
Prefix | Prefix The prefix of the calculated value |
Postfix | Postix Postfix of the calculated value |
Use Thousand Separator? | Thousand Separator toggle. |
Store as Numeric Value? | Toggle to store as a numeric value instead of a string |
...
Name | Description |
---|
Workflow Variable | If the form is part of a workflow process, upon saving of the form (by clicking on the "Save as Draft" or "Save" button). The value in this input field will be saved into the corresponding workflow variable named here. Info |
---|
title | Using a non-existent Workflow Variable name |
---|
| You will get the following warning with the name printed out (e.g. status) in the server log if you attempt to map to a non-existent Workflow Variable.
Code Block |
---|
context attribute status does not exist in process context - adding new attributes to the process context is not allowed |
|
|
...