Using JSON for Complex Data

JSON is the primary format for handling complex data structures in Make.com. Understanding how to work with JSON will help you build sophisticated automation scenarios.

Make.com Custom JavaScript JSON Parameter Example
Make.com Custom JavaScript JSON Parameter Example

JSON input

You can retrieve JSON data directly from the Input field in a Make.com workflow using the JavaScript variable input. For complex data, create a JSON object in the Input field to structure multiple values.


FieldCode
Input[{"First name": "Henrik", "Last name": "Foo"}, {"First name": "Moritz", "Last name": "doo"}]
JS codereturn input.filter(i => i['Last name']).map(i => \ ${i['First name']} ${i['Last name']}\).join('; ');
Output{ output: 'Henrik Foo; Moritz doo' }
Make sure that your input is a valid JSON String and not A Make Collection. Learn how to Transform a Collection to JSON.

Construct JSON in Make.com

You can retrieve JSON data directly from the Input field in a Make.com workflow using the JavaScript variable input. For complex data, create a JSON object in the Input field to structure multiple values.

Example:

  1. In Make.com, choose the Create JSON module and define a data structure.
    Make.com Custom JavaScript JSON Parameter Example
    Make.com Custom JavaScript JSON Parameter Example

The output from the JSON module will be passed into the JavaScript module.

Make.com Custom JavaScript JSON Parameter Example
Make.com Custom JavaScript JSON Parameter Example

  1. Add the customJS Execute inline JavaScript Code module.
  2. In the JavaScript code field, access the data using input.json.firstName:
    return input.json.firstName;
    

Make.com Custom JavaScript JSON Parameter Example
Make.com Custom JavaScript JSON Parameter Example

  1. The Output field will return:
    { "output": "John Doe" }