Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Insert excerpt
_Banners
_Banners
name
actionflow
TableActions
nopaneltrue

This page is for application designers who need to configure functionality in table-actions. It explains how to set context parameters

for an action

.

Overview

When a user triggers

an

a record-action, table-action, PhixFlow can take into account other values or attributes to decide whether or not to run. These are called context parameters. At the start of

an

a table-action, PhixFlow calculates the context parameters first. This is because they are needed to decide whether or not to run the table-action. This is called action validation.

Use context parameters to identify values:

  • to pass from one
dashboard
  • screen to another
  • for action validation
  • that determine
stream item
  • record-actions
  • to determine what your action will do.
    Examples include:
    • which
dashboard
    • screen will open after the action completion
    • which updates will take place (
stream item
    • using record-action rules)
    • whether or not a task plan will run.
Tip

The order of the context parameters is important!

Context parameter values can come from:

  • a field in a form
  • a calculation.
    The source values for the calculation can be
    • a field in a form
    • previous context parameters
  • results obtained from lookups.

You cannot directly refer to a context parameter from another context parameter. However, you can refer to a dollar $-variable that is defined in another context parameter expression. Make sure the dollar variable will be calculated before the current context parameter expression is evaluated. This can be useful to avoid repeating the same calculation. For example, sometimes you need to use a value in both a

stream item

record-action and

dashboard

screen-rule. 

In the table-action properties → Context Parameters section, the Include Previous Context Parameters adds to the context parameters of your table-action any existing context parameters from the

dashboard

screen. You can overwrite them by including it in your table-action and giving it a new value.

For information about setting a global $-variable using a context parameter, see Using

$-variables Throughout an Application

Context Parameter Properties

This properties tab is not available from the repository. It opens from an

action properties →

Table-Action properties → Context Parameters section.

Insert excerpt
_property_toolbar
_property_toolbar
nopaneltrue

Insert excerpt
_

standard_settings_standard_settings

property_tabs
_property_tabs
namebasic-h
nopaneltrue

Insert excerpt
_parent
_parent
nopaneltrue

Basic Settings

FieldDescription
OrderEnter the order in which context parameters will be evaluated.
NameEnter the name of the context parameter.
Either select an attribute name from the drop-down list, or enter a different name.

Use these values as

Select an option to set these values as:

  • Default Values: the context parameter has a default value, which can be changed.
  • Fixed Values: once set the value cannot be changed.
Expression

Enter

the 

the expression for the context parameter. 

Unlike

stream

table-action attribute expressions, context parameter expressions can evaluate to a list of values as well as single values.

The context parameter expressions can refer to:

  • data from the
dashboard
  • screen, form or view
or form
  • from which the table-action was initiated
  • $-variables used in other context parameter expressions on the same table-action.

Use the notation:

  •  to refer to values on a form:
       _prompt.<Form Field Name>   
  • to refer to attributes of selected records:
       <View name or alias>.<Attribute name or alias>   

The expression can include the message functions debug

(message)(message)(message)

, and error

(message)

, which write messages  to the system console logs. Remember

that 

that the error

(message)borderColor#7da054titleColorwhiteborderWidth4titleBGColor#7da054borderStylesolidtitleExample

function stops the table-action from completing.

Panel

Insert excerpt
_audit
_audit
nopaneltrue

Example Context Parameter

A view called Customers shows a list of customers including the account ID, name and other account details. You want to create

an action

a button to open up another

dashboard

screen, containing a view called Invoices, which will show the invoices for the customer selected on the Customers view. To do this:

  1. Add an action button to the Customers view, and configure it to open the
dashboard
  1. screen containing the Invoices view.
  2. Add a context parameter called Account to the table-action, with the context parameter expression set to customers.account_id.
  3. On the background filter of the Invoices view, set the filter to only select those invoices whose account_id is equal to _context.account.

Referring to a Context Parameter

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
  • table-action attribute expressions
  • any
dashboard
  • screen opened by this table-action.

The context values are referenced using the syntax:

Code Block
_context.<context parameter name>


Live Search
spaceKey@self
additionalnone
placeholderSearch all help pages
typepage

Panel
borderColor#00374F
titleColorwhite
titleBGColor#00374F
borderStylesolid
titleSections on this page

Table of Contents
maxLevel3
indent12px
stylenone


Learn More