Skip to main content
Version: 1.28 (Current)

List to JSON

Audience: Low-code Engineers

Skill 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​

Action NameDescription
Create List from JSONDoes the opposite: reads a JSON array into a list.
Create List from SQLCreates a list from the rows of a query.
Existing List as JSONReturns a list as the JSON response of an API endpoint.
Remap ListRenames or reshapes list properties.
Create CSV from ListWrites a list as CSV instead of JSON.
Server RequestSends the JSON to an API.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
List NameThe 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.Yesempty stringNo
Include All FieldsWrites every property of each item, with its own name. When it's off, only the properties in Map Properties are written.NofalseNo
Map PropertiesThe 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.NoemptyYes, unless Include All Fields is on
Additional PropertiesExtra 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 tokensemptyNo
IdentationWrites the JSON on several lines, with indentation, so it's easier to read. When it's off, the JSON is on one line.NofalseNo

Output Parameters Reference​

ParameterDescriptionSupports TokensDefaultRequired
Output Token NameThe token that receives the JSON, for example OrdersJson. If it's empty, the action fails.Noempty stringYes

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/false and 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 as null.
  • 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 nested customer object.

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 Source and source would 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 Error actions. To handle errors, put it inside Execute Actions and use its On Error actions.
  • List names are case-sensitive. Enter the name exactly as the action that created the list did, for example OrdersList, not orderslist.
  • 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​

tip

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