List to JSON
Audience:
Low-code EngineersSkill Prerequisites:
Actions,Lists,Tokens,JSON
Turns the items of a list into a JSON array and saves it in a token. Each item becomes one JSON object. You can keep every property, or choose which ones to write and rename them.
The list comes from an earlier action, such as Create List from SQL or Create List from JSON. In a listing, it can also be the listing's rows.
Typical Use Cases
- Send a list to an API in the body of a Server Request
- Save a list as JSON in a database column or a field
- Pass a list to another workflow, as a token
- Return a list inside a larger JSON response that you build yourself
Don't use it to
- Return a list as the whole response of an API endpoint. Use Existing List as JSON instead.
- Create a CSV or Excel file. Use Create CSV from List or Create Excel from List instead.
- Read JSON into a list. Use Create List from JSON instead.
Related Actions
| Action Name | Description |
|---|---|
| Create List from JSON | Does the opposite: reads a JSON array into a list. |
| Create List from SQL | Creates a list from the rows of a query. |
| Existing List as JSON | Returns a list as the JSON response of an API endpoint. |
| Remap List | Renames or reshapes list properties. |
| Create CSV from List | Writes a list as CSV instead of JSON. |
| Server Request | Sends the JSON to an API. |
Input Parameter Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| List Name | The name of the list to write, for example OrdersList. If it's empty, the default list of the current context is used, for example the rows of a listing. If the list doesn't exist, the action fails. | Yes | empty string | No |
| Include All Fields | Writes every property of each item, with its own name. When it's off, only the properties in Map Properties are written. | No | false | No |
| Map Properties | The properties to write when Include All Fields is off. Each row has a CSV Field Name, which is the list property, for example OrderNumber, and a JSON Property Name, for example number. Hidden when Include All Fields is on. See Choosing properties. | No | empty | Yes, unless Include All Fields is on |
| Additional Properties | Extra properties added to every object. Each row has a JSON Property Name, for example source, and a Value, for example website. See Additional properties. | Only global tokens | empty | No |
| Identation | Writes the JSON on several lines, with indentation, so it's easier to read. When it's off, the JSON is on one line. | No | false | No |
Output Parameters Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Output Token Name | The token that receives the JSON, for example OrdersJson. If it's empty, the action fails. | No | empty string | Yes |
JSON format
The token always holds a JSON array, with one object per item, in the list's order. An empty list gives [].
[{"number":"SO-1001","total":49.90,"createdOn":"2026-09-27T14:30:00"},{"number":"SO-1002","total":12.50,"createdOn":"2026-09-28T09:15:00"}]
- Values keep their types. Numbers,
true/falseand dates are written as JSON numbers, booleans and ISO dates when the list holds them that way, for example a list from Create List from SQL. Empty database values are written asnull. - Lists that hold text give text. Lists from Create List from JSON, CSV or Excel store every value as text, so every value is written as a JSON string, for example
"total":"49.9". - The objects are flat. Property names are written as they are. A list from Create List from JSON gives names such as
"customer.email", not a nestedcustomerobject.
Choosing properties
- Include All Fields writes every property of each item, with its own name.
- Map Properties writes only the listed properties, named by JSON Property Name. The CSV Field Name isn't case-sensitive. Properties that are missing from an item are skipped for that item.
- The properties are written in the item's order, not in the order of the Map Properties rows.
- Listing the same CSV Field Name twice, or giving two properties the same JSON Property Name, makes the action fail.
- If Include All Fields is off and Map Properties is empty, each object is empty, apart from the Additional Properties.
Additional properties
- Each additional property is added to every object, with the same value.
- If an item already has a property with that name, the additional property replaces its value. Here the name is case-sensitive, so
Sourceandsourcewould both be written. - Values are always written as text.
- Only global tokens are replaced in Value, such as
[User:Email]or[DateTime:Now]. Tokens from the action context, such as form fields or the item's own properties, aren't replaced. They become empty. To add a value that depends on context tokens, add it to the list first, for example with Extend List Properties.
Considerations
- Errors. The action fails when there's no list with that name, when the name is empty outside a listing, when Output Token Name is empty, or when property names clash, as described above. It has no
On Erroractions. To handle errors, put it inside Execute Actions and use itsOn Erroractions. - List names are case-sensitive. Enter the name exactly as the action that created the list did, for example
OrdersList, notorderslist. - Using the JSON in other JSON. Tokens aren't escaped when they're placed in JSON, so you can put the token straight into a larger JSON body, for example
{"orders": [OrdersJson]}. Don't put it inside quotes. - Checking for an empty list. Compare with a quoted string, for example
[OrdersJson] == "[]", or check[OrdersList:Count]if the list action created it. - Large lists. The whole list is written into one token. For very large lists, filter or paginate the list first.
Examples
To understand how to use the below examples, please see Running Examples.
1. Send selected order properties to an API
This action writes three properties of each item in OrdersList, renamed to number, total and createdOn. It adds a source property with the value website to each object. The JSON is saved in the OrdersJson token, for example to send in the body of a Server Request.
{
"Title": "List to JSON",
"ActionType": "ListToJson",
"Description": "Build the orders JSON for the API",
"Parameters": {
"ListName": "OrdersList",
"IncludeAllFields": false,
"MapProperties": [
{
"name": "OrderNumber",
"value": "number"
},
{
"name": "Total",
"value": "total"
},
{
"name": "CreatedOn",
"value": "createdOn"
}
],
"AdditionalProperties": [
{
"name": "source",
"value": "website"
}
],
"Identation": false,
"OutputTokenName": "OrdersJson"
}
}
2. Write a whole list as readable JSON
This action writes every property of each item in ContactsList, with indentation. It adds the email address of the current user as exportedBy. The JSON is saved in the ContactsJson token.
{
"Title": "List to JSON",
"ActionType": "ListToJson",
"Description": "Write the contacts as JSON",
"Parameters": {
"ListName": "ContactsList",
"IncludeAllFields": true,
"MapProperties": [],
"AdditionalProperties": [
{
"name": "exportedBy",
"value": "[User:Email]"
}
],
"Identation": true,
"OutputTokenName": "ContactsJson"
}
}
Revised 09/27/2026