Context to JSON Array
Audience:
Low-code EngineersSkill 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.
Related Actions
| Action Name | Description |
|---|---|
| Context to JSON Object | Saves the context tokens as a JSON object instead of an array. |
| Parse JSON Into Tokens | Turns a JSON string back into tokens. |
| Create List from JSON | Creates a list from a JSON array. |
| Create/Update Tokens | Creates or changes tokens in the context. |
Input Parameter Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Store Result | The 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. | No | empty string | Yes |
| Include Prefixes | Token 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. | Yes | empty string | No |
| Exclude Prefixes | Token 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 line | No |
Output Parameters Reference
| Parameter | Description |
|---|---|
| Store Result | The 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.
customermatchesCustomerName. - 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, andQueryStringtokens. 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:FileNameandPhoto:MimeType. Use a prefix likePhoto: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
:Base64token 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