Destructuring http request response

Hi Guys,

Is there an option to destructure http request responses, I could not find it via the HTTP Request node, but I wanted to double check before looking to add it.

At the moment, I believe we need to add additional nodes to “handle” API responses which don’t include the response data we want in the root object, for exmaple:

A simple solution would be to have an additional options option in the node called Destructure which would allow the user to specify the value in the object they want to return. In my example it could be $json.users which could return the users array.

This would mean my HTTP Response node returns the 3 users and not an object containing a users array.

Please let me know if there is already a solution inside the HTTP Response node I am not aware of or if you think this feature would be helpful.

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:

@Andy-Slack , HTTP Request node is meant to be generic. You would have to reference the data with the subsequent node. However, instead of Code node in your case I would use Split Out node.

2 Likes

Thanks @ihortom that work’s perfectly!

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