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

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