Skip to content

Context values

A context value is a container for a value with a specific unique name. You can reference a context value to retrieve its current value. This is useful when the value is not known in advance (for example, user input), and you want to assign it an alias that can later be used to access the actual value.

Context values can be generated by a widget flow node. It's worth noting that there's a separate type of context values called secrets — you can read more about secrets and why they’re needed on this page: Secrets.

The full name of a context value consists of the context value's name and the ID of the widget flow node that generated it, for example, 1.result. In the case of secrets, the ID is replaced with a constant string secrets, for example: secrets.api_token. The name can contain lowercase letters, digits, and underscores, and its length must not exceed 32 characters (excluding the widget flow node ID).

If the source of a context value contains unsupported characters, the name undergoes an operation called slugify. During this operation, the string is converted to lowercase, all invalid characters are replaced with _, consecutive underscores are collapsed into one, and leading and trailing underscores are trimmed. If the source is empty, the context value name will be _. For example, you have an user-input field called "Personal info (bio)", so context value name will be converted to X.personal_info_bio.

The type of a context value is always a string. If a context value does not exist (i.e., no widget flow node generates it), it will be highlighted in a specific way, and any attempt to access it will always return an empty string. This can happen if your widget flow node was previously connected to another node that generated the context value and was later disconnected.

Deleting node

You can imagine context value as "flowing" between widget flow nodes through connections, which is why a specific node can only use context value that were generated by nodes along the path leading to it.

You can insert a context value anywhere to get the desired result. For example, you can insert two (or more) context values in a row to concatenate them. Also, you can combine context values with any other symbols.

Context values demo

Compilation

Compilation is the process of transforming a string containing context values into a regular string with the values substituted.

Limitations

NameValue
Max length32
Min length1
Allowed charactersa-z, 0-9 and underscore (_)