Sending array to http request

Hello, I have an array which i retrive from Google Form submission as following,

I would like to send the grey text as this layout to webhook end point using http request.

may i know which node could i use to send ?

currently, if i use “add expression”, only google form answer is displayed.

secondly, my google form has different set question depending on user selection, thus, question and answer retrieve from google form will be different from form fill up person. this make “add expression” not suitable.

You can set the expression to $json["original"]. That way, you always send the whole object instead of the individual properties.

Hello, i use slack for try out and it works.

$json[“original”]

however, it send in a single line as shown below.

slack message below.

are we ableto have a line break at the “,” by replacing “,” with “/n” ?

If the body was not dynamic, you could have used multiple expressions to achieve this, but since it’s not, you need to use a function node to format the Text string property. Add a function node with the code below after the Set node.

const json = items[0].json

let response = '';

for (const key of Object.keys(json)) {
  response+= `${key}=${json[key]}/n`
}

return [
  {
    json: {
      text: response
    }
  }
]
Example workflow
{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "return [\n  {\n    json: {\n      name: 'ricardo',\n      location: 'xxxx',\n      Description: 'asasasas'\n    }\n  }\n]"
      },
      "name": "Function",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        550,
        300
      ],
      "notesInFlow": true,
      "notes": "Mockup data"
    },
    {
      "parameters": {
        "functionCode": "const json = items[0].json\n\nlet response = '';\n\nfor (const key of Object.keys(json)) {\n  response+= `${key}=${json[key]}/n`\n}\n\nreturn [\n  {\n    json: {\n      text: response\n    }\n  }\n]\n"
      },
      "name": "Function1",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        770,
        300
      ],
      "notesInFlow": true,
      "notes": "create text"
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Function",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Function": {
      "main": [
        [
          {
            "node": "Function1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Hello ,

I use setnode to obtain as following


however, when i use function node, i get the following response.

That is because you changed the key. If you are going to keep test use the function as shown below.

const json = items[0].json.test

let response = '';

for (const key of Object.keys(json)) {
  response+= `${key}=${json[key]}/n`
}

return [
  {
    json: {
      text: response
    }
  }
]

note…thank you very much