Tuesday, April 26, 2022

Improvements to variables in formulas

An important feature of Orbeon Forms are formulas. They allow you, as if the case in spreadsheets, to perform calculations of values and much more.

Some formulas can refer to the current value of form controls using a variable notation, with a dollar sign followed by the name of the control. So if you have a form control called price, you can refer to its value in a formula with $price.

However, until Orbeon Forms 2021.1 included, this variable notation didn’t work everywhere. You could use it for:

  • Validation Constraints
  • Visibility, Read-Only, Initial Values, and Calculated Values

The good news is that Orbeon Forms 2022.1 will feature enhanced support for variables in formulas. Specifically, variables will be supported in the following places:

  • Repeated Sections and Grids
    • Minimum Number of Repetitions
    • Maximum Number of Repetitions
    • Freeze Repetitions
  • Control Settings Templates
    • Label
    • Hint
    • Help Message
    • Explanatory Text
  • Number
    • Prefix
    • Suffix
  • Service Response
    • Source of control value
    • Source of choices, including label, value, and hint
  • Dynamic Dropdown and Dynamic Dropdown with Search
    • Resource URL

For example, assuming controls named state and city, a zip Dynamic Dropdown Resource URL might be expressed as:


This, in fact, was a top request for enhancement from Orbeon Forms users!

Variables in the Resource URL
Variables in the Resource URL

Note that, as with other uses of variables, if you rename a form control, dependent formulas are automatically updated as well. For example rename state to us-state and the expression is automatically updated to:


We hope you will enjoy this improvement to Orbeon Forms in Orbeon Forms 2022.1!

No comments:

Post a Comment