An expression for the context parameter. The Context Parameter context parameter expressions can refer to any values entered on the Form View form view using the notation:
Code Block |
---|
_prompt.<Form Field Name> |
The Context Parameters context parameters can also refer to any attributes of any records selected on the view or dashboard from which the action was initiated using the notation:
Code Block |
---|
<View name or alias>.<Attribute name or alias> |
Context parameters may also refer to $-variables used in other context parameter expressions on the same action.
It is not possible to refer to one context parameter from another.
The values returned by the context parameter expressions can be referenced by the Validation expression, the Filter, the Maximum and Minimum Items expressions, any Stream Action Attribute expressions and any dashboard opened by this action.
The context values are referenced using the syntax:
Code Block |
---|
_context.<context parameter name> |
Example
For example, you have a view called 'customers' which Unlike stream action attribute expressions, context parameter expressions can evaluate to a list of values as well as single values.
The usual message functions debug(message), info(message), warning(message), and error(message) are all available to be used in these expressions and will result in messages being written to the system console logs.
Be careful when using the error(message) function as this will stop the action from being completed.
Panel |
---|
borderColor | Green |
---|
titleBGColor | green |
---|
borderStyle | solid |
---|
title | Example |
---|
|
A view called Customers shows a list of customers including the account |
idID, name and other account details. |
You want to create an action button to open up another dashboard, containing a view called |
'invoices' Invoices , which will show the invoices for the customer selected on |
the 'customers' To do this: - Add an action button to
|
the 'customers' - the
Customers view, and configure it to open the dashboard containing
|
the 'invoices' - the
Invoices view - Add a context parameter called
|
'account' -
Account to the action, with the context parameter expression set to customers.account_id - On the background filter of the
|
'invoices' -
Invoices view, set the filter to only select those invoices whose account_id is equal to _context.account
|
Unlike stream action attribute expressions, context parameter expressions can evaluate to a list of values as well as single values.
The usual message functions debug(message), info(message), warning(message), and error(message) are all available to be used in these expressions and will result in messages being written to the system console logs.
Be careful when using the error(message) function - this will stop the action from being completed