``Function

Common features shared by all Functions. More info.

Parameters

Key Description Default value Possible values
name Name of the Function undefined string
stayAlive Prevent the Function from being destroyed after execution. none
  • none: destroy after execution
  • dashboard: stay alive until dashboard switch
  • session: stay alive until page refresh.
  • execution: stay alive until (but no longer than) Function executed succesfully, even if Dashboard was switched in the meantime.
kill If set to true, closes an open Function. undefined true
showErrors If set to false, errors occurring in the Function will not be shown. false true/false
_instance Specifies an existing instance that should be updated. If the instance does not exist, it will be created. More info: Updating Functions _new
_instanceUpdateOnly If set to true, will only update the given instance (_instance) if it already exist. Will not create new instance. false true/false
_path Value that will persist through following Triggers. More info Incoming $_path value. object
_update Changes values in lists. Possible keys: add, remove, set, change, update. See explanation below.

Update parameters

The #_update parameter allows updating of parameters that are lists in the Function. These are the options.

Key Description
_update.add Adds values to lists.
_update.remove Removes values from lists.
_update.set Adds or updates values in lists.
_update.change Changes properties of objects in lists.
_update.update Updates values in lists.

Each of the update operators (add, remove, set, update and change) take an object of lists, with parameter names as keys and a list of items to add/remove/update/change as values. E.g.: #_update.remove.myList: [{id:15},{id:20},{id:110}] removes the items with id 15, 20 and 110 from the list stored in the parameter myList. More info.

Outgoing Triggers

Event structure

Every outgoing Trigger from any Function contains a base set of properties. Specific Functions may add properties to this event, often depending on the event type. The base properties are listed below:

Key Description Possible values
type Trigger event type. Any of the Function's Trigger event types
_function Accessible internal data of the origin Function. Object with all parameters and their values.
_function.name (example) One of the Function parameters. The value of the parameter.
_path If not specifically altered, this will be passed on from Function to Function Object with custom properties and values.

Type: functionExecuted

Fires when the Function has completed its execution actions.

Additional event properties (besides the inherited properties):

Key Description Possible values
data Parameter values with which the Function was executed. object

Type: functionUpdated

Fires when the Function model was updated.

Additional event properties (besides the inherited properties):

Key Description Possible values
data Changed values in the model object
changed Array of changed paths array

Type: functionClosed

Fires when the function instance was closed.

Additional event properties (besides the inherited properties):

Key Description Possible values
origin Indicates the origin of the closing. user/function/replaced*

* Origin values explained:

  • user: when the user closes the Function by closing a panel.
  • function: when the Function closes itself or gets closed by an incoming Trigger.
  • replaced: when the Function (View)'s panel gets re-used for another Function.

Type: error

Fires when the Function encounters an error.

Additional event properties (besides the inherited properties):

Key Description Possible values
error Error object containing error information object

Permissions (beta)

All Functions can require the following Permissions:

for: read

Determines: whether or not the Function can be read or loaded.

No context
The (%) in this permission requirement is an empty object.