How do i get the "body" inside the split out node

good day everyone.

How can I get the body from previous node? I wanted to use the content of the body to rewrite it to another http node with POST method. is my json body wrong? or is there any missing syntax I overlooked?

Thank you.

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:

cause when I manually add the news context it does rewrite, but when I use {{ json.body}} it doesn’t work and change language.

body from each different news, so i had to use json.body

You seem to have missed switching on the expression mode for the JSON field.

image

1 Like

i tried, but i do get this error.
image
image

@Everett_Sobinsky , to utilize body in the JSON field you have to switch to expression mode. The error about invalid JSON stems from the body’s multi-line string as JSON does not allow it.

To resolve. compose your JSON as below

{{
{
  "inputs": {
    "input_text": $json['body'],
    "translate_to": "english"
  },
  "response_mode": "blocking",
  "user": "abc-123"
}
}}

This will turn your multi-line string into a single line.

Moreover, I see no reason for the 2nd Split Out node. That is, the following should do

1 Like

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