Remove Parent Field in JSON Response

Hi @RicardoE105, I have a similar request but I am running into an issue with the function.

I am using the HTTP Request node to just like Asi_Joshi did but the API response contains nested arrays in my case. As an example, instead of Contacts, I have user-data or session-data and a preceding column in the table with a single timestamp that I want to skip.

Here is the updated function code I used.

const results = []

for (const item of items[0].json.session-data) {

  results.push({
    json: item
  })

}

return results;

I am getting the following error.

ERROR: data is not defined

Thanks!