Skip to main content
Version: 1.28 (Current)

Context to JSON Array

Audience: Low-code Engineers

Skill Prerequisites: Actions, Tokens

Saves the tokens in the current context as a JSON array of Name/Value pairs, and stores it in a token. You can limit which tokens are included by the start of their names.

Each token becomes one entry:

[
{ "Name": "FirstName", "Value": "Jane" },
{ "Name": "Quantity", "Value": "3" }
]

Typical Use Cases​

  • See which tokens exist while you build an application, and what their values are
  • Log the state of a form or workflow at a certain point, for example with Log Event
  • Send a set of tokens to an API that expects a list of Name/Value pairs, for example with Server Request

Don't use it to​

  • Build a JSON object with property names. Use Context to JSON Object instead.
  • Build JSON with specific properties and types. Use Create JSON Object instead.
  • Show the token list to end users. It can contain internal or sensitive values.
Action NameDescription
Context to JSON ObjectSaves the context tokens as a JSON object instead of an array.
Parse JSON Into TokensTurns a JSON string back into tokens.
Create List from JSONCreates a list from a JSON array.
Create/Update TokensCreates or changes tokens in the context.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
Store ResultThe name of the token that receives the JSON array, for example ContextList. Enter the name without brackets. If it's empty, the action fails with No token name has been provided for the result.Noempty stringYes
Include PrefixesToken name prefixes to include, one per line. Only tokens whose names start with one of them are included, for example customer includes customerName and customerEmail. Leave it empty to include all tokens.Yesempty stringNo
Exclude PrefixesToken name prefixes to leave out, one per line, for example customerAddress leaves out customerAddress1 and customerAddress2. Leave it empty to exclude nothing.Yes_, $ and QueryString, one per lineNo

Output Parameters Reference​

ParameterDescription
Store ResultThe token named in Store Result. It contains a JSON array with one { "Name": ..., "Value": ... } entry per included token.

How tokens are selected​

  • Prefixes are compared with the start of each token name, ignoring case. customer matches CustomerName.
  • Exclude Prefixes wins. A token that matches both lists is left out.
  • The default exclude list leaves out tokens starting with _ or $, which are mostly internal, and QueryString tokens. Clear it to see everything.
  • Prefixes aren't trimmed. A line with a trailing space won't match.
  • Sub-tokens are separate context entries, so they're listed separately, for example Photo:FileName and Photo:MimeType. Use a prefix like Photo: to get only those.

Considerations​

  • All values are strings. Numbers, booleans and JSON text are written as strings, for example "3" and "true". Empty values are written as "".
  • Some values aren't shown. Tokens that are calculated only when used, such as the :Base64 token of an uploaded file, get the value (Content not displayed).
  • Order isn't guaranteed. Don't rely on the entries being in a particular order.
  • Size. Without include prefixes, the result can be large. Use Include Prefixes to keep it small.
  • Security. The result can contain user data and internal values. Don't display it to end users or send it to systems that shouldn't see it.

Examples​

tip

To understand how to use the below examples, please see Running Examples.

1. List all tokens while debugging​

This action stores all tokens, except the default exclusions, in ContextList. Show [ContextList] in a Display Message to inspect it.

{
"Title": "Context to JSON Array",
"ActionType": "ContextToJSONArray",
"Description": "List all tokens for debugging",
"Parameters": {
"StoreResultName": "ContextList",
"ExcludePrefixes": "_\n$\nQueryString"
}
}

2. List only the customer tokens​

This action stores the tokens whose names start with customer, except the address tokens, in CustomerList.

{
"Title": "Context to JSON Array",
"ActionType": "ContextToJSONArray",
"Description": "List the customer tokens",
"Parameters": {
"StoreResultName": "CustomerList",
"IncludePrefixes": "customer",
"ExcludePrefixes": "customerAddress"
}
}

With the tokens customerName = Jane Doe, customerEmail = jane@example.com and customerAddress1 = 1 Main St, the result is:

[
{ "Name": "customerName", "Value": "Jane Doe" },
{ "Name": "customerEmail", "Value": "jane@example.com" }
]

Revised 09/26/2026