Making Buttons run a process
Button components can be configured to execute a process through the Process Name property located in the Interactivity section. Below are several methods for setting up and passing variables to these processes.
Note: For methods 2., 3., and 4. below, the target process must include the
script.prompt
method in order to accept values from the card.
All references to variable name
in the examples below correspond to the variableName
argument used in the script.prompt
method:
js
script.prompt(messageToUser, variableName, defaultValue)
1. Executing a Process - Basic
To execute a process, simply set the Process Name property to the process you want to run: processName
A working example would be to set Process Name to: System.Dimension.Time
2. Executing a Process - with Prompts
In addition to the Process Name, you can pass static values to the process using the Process Arguments or Process Client Arguments properties in the Interactivity section.
To pass a value for use in a process would follow the below: [variable name]=[value]
A working example would be to set Process Arguments or Process Client Arguments to: timePrompt=2022
3. Process Execution with Dynamic Prompts
You can also pass dynamic values using expressions. Click the π (pi) icon next to the property to open the formula editor, where you can use functions like ELEMENT()
or VARIABLE()
.
The syntax requires using double quotes and concatenation via the & symbol.
Setting the context of a single dimension would follow the below structure (using ELEMENT()
as an example): "[variable name]="&ELEMENT("Element Name")
A working example would be as follows: "timePrompt="&ELEMENT("Time")
4. Process Execution with Multiple Dynamic Prompts
To pass multiple dynamic variables, extend the same concatenation method shown above. Wrap each variable assignment in double quotes and concatenate them using &
.
Format: "[variable name]="&ELEMENT("variable name")&"&[variable name 2]="&ELEMENT("variable name 2")
A working example would be as follows: "timePrompt="&ELEMENT("Time")&"&scenPrompt="&ELEMENT("Scenario")