Parsing a JSON Array?

Describe the problem/error/question

Hey Team! I’m not really sure how to parse a JSON array with multiple entries. Example JSON payload here for reference:

{
“data”: [
{
“token”: “Jhj5dZrVaK7ZwHHjRyZWjbDl”,
“challenge”: “This is a test input 1. Please validate.”,
“type”: “url_verification”
},
{
“token”: “Jhj5dZrVaK7ZwHHjRyZWjbDl”,
“challenge”: “This is a test input 2. Please validate.”,
“type”: “url_verification”
}
]
}

I’m trying to build a flow where I can pull out each of the entries’ challenges and map them to a singular downstream API call.

I believe that the loop over items node is how to pull this off but I’m not 100% sure. Any support is much appreciated!

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

I don’t have these specifics as my question is more general in nature. Thanks

@cs_lec , normally you do not need a loop. An API call made by, say, HTTP Request node will make individual calls for each of the items automatically (if that is what you want). You do need to split the items out (unpack from the array) first as shown below.

The outcome becomes

2 Likes

Exactly what I needed. Thanks for the support here!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.