Google sheets append

I’m having some trouble figuring out how to pipe the data into google sheets.

I’m coming from the XML to JSON node and the rows i’m trying to use in google sheets would be:

$data[“serv:message”][“serv:body”][“serv:bodyContent”][“use:user”][“use:userId”]
$data[“serv:message”][“serv:body”][“serv:bodyContent”][“use:user”][“use:name”]

where use:user is the array that the google sheets node is supposed to magically know how to iterate over.

do I need a Set step in between, or a function / or function item?

If “use:user” is an array then the only choice you currently have is a Function-Node. In that node you would have to iterates over the items in “use:user” and return for each of it a key: value pair of the data that should be appended.

So the data you return in the node would have to have this format:

return [
  // First array item of “use:user”
  {
    json: {
      nameOfFirstRow: "value to set in first row",
      nameOfSecondRow: "value to set in second row"
  },
  // Second array item of “use:user”
  {
    json: {
      nameOfFirstRow: "value to set in first row",
      nameOfSecondRow: "value to set in second row"
    }
  }
]

The above data would then append two rows to the Google Sheet.

I hope that helps. If not, simply post example data that gets currently output by your node and I can then create the Function-Node for you.