Skip to main content

au-widget-function-trigger/IAuWidgetFunctionTriggerConfig

Interfaces​

IAuWidgetFunctionTriggerConfig​

Provides properties that are used to execute synchronous or async functions.

You can use these properties in params of the AuWidgetFunctionTrigger class.

The following example illustrates how you can listen for property changes to execute a custom function.

{
"widgets": [
{
"name": "name",
"type": "option",
"params": {
"type": "list",
"title": "Name",
"prompt": "Choose a name",
"values": [
{ "title": "Jack" },
{ "title": "James" },
{ "title": "John" }
]
}
},
{
"name": "myFunction",
"type": "function-trigger",
"params": {
"arguments": [
"{{ $['name']._.title }}",
"{{ $['name']._.title }}"
],
"callback": [
"{{ #function(arg1, arg2) console.log(arg1, arg2) }}",
"{{ #asyncFunction await new Promise(...) }}"
]
"catch": [
"{{ #function console.error("failed") }}",
],
"finally": [
"{{ #function console.log("cleanup") }}",
]
}
}
]
}

Properties​

arguments​
arguments: string | string[];

An array of parameters change of which should trigger specified callbacks.

callback​
callback: Function | Function[];

A function ("{{#function <expression>}}") or an array of functions that are executed when arguments parameter changes.

catch​
catch: Function | Function[];

A function ("{{#function <expression>}}") or an array of functions that are executed if the callback fails.

enabled​
enabled: boolean;

If false, the callback will not be executed. The default value is true.

finally​
finally: Function | Function[];

A function ("{{#function <expression>}}") or an array of functions that are executed after the callback, regardless of its outcome.

lock​
lock: string | string[];

The widget names that should be locked while waiting for the callback. The editor will show a preloader on this widget.

Was this page helpful?