Skip to main content
Function Set()

Declare, initialize and update a variable in the automation execution context

Sergey Shurygin avatar
Written by Sergey Shurygin
Updated over a week ago

Use Set(name, value) to store value in a key name in the current level of the execution context, so it can later be read using Twig variables.

The function will try to find the key named name in the current context, and then up the context stack. If no such key is found, the key will be added to the current context. If the key was found, it will be updated with the value.

Note. The key's value will be lost when the current execution context is destroyed. If you need to store data in a persistent storage, for example to pass data between multiple execution session over time, use SetGlobalParam().

How to use

Use the function in the following way:

Set(name, value)

Input

  • name: the name of the variable (execution context key) to set or update.

  • value: the target value of the variable. The variable type is automatically determined by the value.

Output

None.

Examples

Set("recordsFound", false)

Set("emailBody", "")

Set("recordId", null)

See also


โ€‹

Did this answer your question?