PhixFlow Help

Stream Item Action Rules

This page explains how to set the properties for stream item action rules.

Stream action rules connect data in a stream with an action.

This setting is not available from the repository browser. It opens from an action properties → Stream Item Action Rules section.

The toolbar has the standard iconsFor information about the sections Parent Details, Analysis Models, Description and Audit Summary, see Common Properties.  For information about other property tabs, see Property Tabs.

Basic Settings

FieldDescription
Stream Item Action
Select an option from the drop-down list:
  • None
  • Insert
  • Delete
  • Update

Deleting records with an action is non-reversible. In some circumstances it may therefore be better to select an Update action to simply mark the records as 'deleted' and then configure an Archive Task to remove records marked as deleted after a certain period of time. This will provide a window of opportunity for these 'deletions' to be reversed manually if they are made by mistake. If you don't want your users to see these deleted records, simply filter them from any views.

Filter TypeSelect an option from the drop-down list:
  • Selected Items - Action will only apply to the records selected on the view from which the action was initiated unless the Target View is specified.
  • Edited Items - Action will only apply to the updated records on the view from which the action was initiated unless the Target View is specified.
  • View Filter - Action will only apply to the records shown on the view from which the action was initiated unless the Target View is specified.
  • Action Filter - Action will only apply to the records retrieved by the filter defined in the action.
  • Dragged Items - Action will only apply to the records which are being dragged in the case that this is a drag and drop action.
  • Drop Target Items - Action will only apply to the records which are having records dropped onto them in the case that this is a drag and drop action.
Target ViewIf specified, changes the view the action applies to (gets records from if selected Filter Type = Selected Items, Edited Items or View Filter).
Condition

This is only available if you have selected Filter Type = Action Filter.

Create a filter to specify the records that an Update or Delete will apply to. Any expressions on this filter can reference the Form View fields, Context Parameters and any attributes from any record selected on the view or dashboard from which this action was initiated. Configure this filter in the same way that you would a pipe filter.

Copy Values By Name

This is only available if you have selected Stream Item Action = Insert or Update.

If this flag is ticked, all Stream Item Attributes which are not present on the Action Attributes list below will take their new values from the current form.

This will only apply to records which have a corresponding record on the form.

Action Attributes

The list of attributes that will be populated by the action - whether an update or insert.

This section includes the button - this brings up the list of attributes for the stream that you are building the action on. Drag any attributes you want from this list into the action, or add them by pressing .

For each attribute, configure the following fields:

FieldDescription
OrderThe order in which the action attributes are evaluated. 
AttributeThe name of the stream attribute that will be populated.
Expression

The expression used to generate the new attribute value. This is written as a PhixFlow Expression.

  • Dashboard Element Name You can reference selected records from other dashboard views by using their dashboard element names within the expression. E.g.
sum(ACCTS.amount)

will sum up all values in amount from the records select in the view with dashboard element name ACCTS.

  • No Prefix  If you want to refer to the current values of the record you are about to update, then simply refer to the attribute name with no prefix.


  • _prompt  You can reference fields from any user input form associated with this action by referencing the form field name prefixed by _prompt.


  • _form   You can reference the current value displayed in a field on the form by using _form as a prefix.
    For example: In the screenshot below, the expressions use _form to reference fields that are displayed on the form (Unit Price, Quantity and VAT Percentage). 

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 for the current stream item. However, it will not stop the action from updating/ inserting other stream items.

  • _out   You can also use the prefix _out to reference the current value of an attribute in the action. Note that in the above example, to use the value for the attribute ChargeAmount in VATAmount the expression uses _out.ChargeAmount.


  • _context Reference any context variable defined on this Action or passed through to this Action.


  • _gridRow When the Filter Type is Edited Items this object contains a recordset pointing to an individual row that had been modified.


  • "pipe" Expressions can refer to lookup pipes on the same stream as the action. Note that at version 7.6.0, lookup pipes used in this way can only be driven by $ variables i.e. if the lookup filter or cache lookup needs to be driven by values from the action, then those values nust be passed in by $ variables. The pipe cannot reference _out variables directly. 


Please let us know if we could improve this page feedback@phixflow.com