Using the Calculate Rule

Users can create Calculate rules that populate a numeric field by calculating its value based on other fields. For example, a Calculate rule can calculate a camp or conference’s total registration costs by multiplying the number of attendees and the registration fee (17 people at $130 each).

important

Calculations are limited to numeric fields.

This example has a form with three numeric fields:

  • Number of attendees: a numeric field.
  • Registration Fee: a numeric field with a predefined value of 150.
  • Total: a numeric field where the total will be displayed.

Configuring the Calculate Rule

The calculation is defined using the embedded calculator. Use a mix of numeric field values, mathematical operators, and constants to define calculation rules.

Follow the steps below:

  1. Click the Rules tab.

  2. Click the Add (Add) button.

  3. Select the Number of attendees from the If dropdown menu.

  4. Create the condition: Is greater thanValue0.

  5. Select Calculate from the Do dropdown menu.

  6. Select Total from the Choose a Field to Show the Result dropdown menu.

  7. Using the embedded calculator, enter (NumberofAttendees*RegistrationFee).

    Calculate the registration total by multiplying the two fields.

  8. Click Save when finished.

The Calculate Rule has been created.

Calculate the registration total by multiplying the two fields.

Capabilities

Product

Contact Us

Connect

Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy