Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel
Definition
borderColorgreenpurple
borderWidth1
titleBGColor#ddffcc#ddccff
borderStylesolid
titleNew Feature

New feature added in Joget DX :

  • Store as Numeric Value option 

Table of Contents

Introduction

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.

...

Image Removed

Figure 1: Screenshot highlighting Calculation Field taken from sample HR Expenses Claim app

Screenshots taken from http://localhost:8080/jw/web/console/app/hr_expense/1/form/builder/hr_expense_claim

Image Removed

Figure 2: Calculation Field Properties

Here are the steps:

StepsScreens (Click to view)
  1. Start Joget Server and open the App Center.

  2. Log in as admin and click on the pencil icon on the Expenses Claim to open the Design App. (see Figure 1)

  3. Under FORMS column, click on Expense Claim Form (see Figure 2):
  4. Hover the mouse over the Calculation Field labeled Total Amount $ on the canvas and click on Edit to open up the Edit Calculation Field properties.

  5. Take note of the Variables field.  The spECD value is referring to another field within the form (see Figure 3).

  6. Hover the mouse over the Grid element on the canvas above the Calculation Field and click on Edit to open up the Edit Grid properties (see Figure 4).

  7. 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: spECD.amount

Image Added

Figure 1


Image Added

Figure 2


Image Added

Figure 3


Image Added

Figure 4


Image Added

Figure 5



Calculation Field Properties

Edit Calculation Field

NameDescriptionScreens (Click to view)
NameDescription
IDElement ID (By declaring as "total", a corresponding database table column "c_total" will be created)

Image Added

LabelElement Label to be displayed to end user.
Variables
NameDescription
Variable NameDeclare a name to store current row equation result.
Field ID

Form Field ID to retrieve

.

In the example above, we are summing at a specific column from a Form Grid.

Form Grid ID: entries

Column in Form Grid: formattedAmount

Field ID to be filled in: entries

.

formattedAmount


Multivalue Operation
  • Sum
  • Avg
  • Min
  • Max
EquationArithmetic operation using the variables declared above.

 

...

...



Advanced Options

Data

NameDescriptionScreens (Click to view)
Validator

Attach

a

Form Validator plugin to validate the input value.

Info
titleWhen will validation takes place?

Validation will takes place whenever form is submitted except when it is submitted as "Save as Draft".

Image Added

Format

NameDescriptionScreens (Click to view)
Formatting Style
  • US Style Formatting (1,000.00)
  • European Formatting (1.000,00)

Image Added


Number of DecimalNumber of Decimal
PrefixPrefix of the calculated value
PostfixPostix of the calculated value
Use Thousand Separator?Thousand Separator toggle.
Store as Numeric Value?

Toggle to store as numeric value instead of a string

Info
titleNew Feature

Newly introduced in Joget DX 7

UI

NameDescriptionScreens (Click to view)
Hidden?Shows this element to the end user.

Image Added

Display as Label?Displays the value of the element as plain text.

Workflow

...

NameDescriptionScreens (Click to view)
Workflow Variable

If the form is part of a workflow process, upon saving of the form (by clicking on "Save as Draft" or "

Complete

Save" button). The value in this input field will be saved into the corresponding workflow variable named here.

Info
titleUsing 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

 


Image Added