Referencing Previous Node Output in HTTP Client JSON/RAW Body Parameter

Hi, similar to what some of the earlier members may have mentioned - I am having trouble using the JSON/RAW approach when wanting to reference the output of earlier nodes. I get caught in a loop of it not recognising any valid JSON. The flow works fine if I write directly into the body parameters, though whenever I try to reference a previous step I get the error

“ERROR: The data in “Body Parameters” is no valid JSON. Set Body Content Type to “RAW/Custom” for XML or other types of payloads”

When I then go to add headers as per mentioned here I can’t get it to work either. Was there a solution on how to reference previous nodes when using JSON/RAW?

1 Like

Hi @LBAdam,

Thanks so much for sharing your example workflow!

Assuming you want to send a JSON payload, this approach should work (essentially wrapping the entire expression inside {{ and }} so we have a valid JSON object rather than a JSON-like string):

This results in the below payload being arriving on the webserver:

image

Or did you want to use Form-Data Multipart as your HTTP node suggests? If so, you couldn’t use nested data structures and would need to do something like this:

Resulting in this data arriving on your server:

Thank you mate. The issue I was facing was actually the removing of the {{ }} from the previous node after adding the {{ at the start. Your example helped me figure it out, so thank you for that!

1 Like

Glad to hear this works, thx for confirming!