Converting Complex Data Structure in Make to JSON Array

I’m working on an integration workflow in Make where I need to transform data from one HTTP module to be used as a request body in another HTTP module.

Current Situation:

  • Source: An API that provides a list of items
  • Desired Format: I want to obtain a JSON array like this:

json

[  
  {"category": "Puxador", "chosen": "C/ Puxador"},  
  {"category": "Perfil", "chosen": "Veneziana"}  
]  

Problem:
When processing the data in Make, the array appears to have an unclear or complex data structure. I’m unable to determine if it’s a proper array of JSON objects or something else entirely.

Specific Questions:

  1. How can I verify the exact data structure in Make?
  2. What are the best methods to convert this data into a clean, usable JSON array?
  3. Are there any Make-specific techniques to transform this data?

Additional Context:

  • I’ve already confirmed the original API request returns the data in the expected format. Example: [{“category”: “Puxador”, “chosen”: “C/ Puxador”}, {“category”: “Perfil”, “chosen”: “Veneziana”}]
  • I’m using two consecutive HTTP modules to process this data, pre-processing and post-processing.
  • The issue lies in Make’s interpretation of the data structure
  • The focus of this matter is the Data object as below:

Looking for: A reliable method to convert the current data structure into a standard JSON array that can be used in subsequent processing steps.

Hi Luiz,
You can simply use a debug action or inspect the payload right after fetching it from the API. This will give you an idea if it’s coming through as expected.

As for converting the structure into a clean JSON array, Make has some neat tools that can help you out. You might want to try using their iterator blocks to parse through your data and then reshape it into the desired format. Essentially, you can create each JSON object individually within the iteration and build up your final array.

Which iterator blocks would you recommend?