Creating a text block from Google Sheet rows

Read rows from Google Sheet returns:
[

{

“row_number”: 2,

“First”: “Bruce”,

“Last”: “Wayne”,

“Hero”: “Batman”

},

{

“row_number”: 3,

“First”: “Peter”,

“Last”: “Parker”,

“Hero”: “Spiderman”

},

{

“row_number”: 4,

“First”: “Diana”,

“Last”: “Prince”,

“Hero”: “Wonder Woman”

}

]

How can I create a single text block (like to include in a single email) like this?

Bruce Wayne
Batman

Peter Parker
Spiderman

Diana Prince
Wonder Woman

I’ve tried the community node Document Generator, but the help docs show using {{#each items}}
which gives me a syntax error.

The only difference I can find is that Sheet’s wraps the items in square brackets while the source sample in the docs don’t. It just shows {}.

But I can’t figure out a way to remove the from the Sheets output.

I tried the Aggregate node, but it also wraps in square brackets.

Helllo,

You can do it with one code block if you want to convert it all at once, or run it through a loop and convert it for each row. Here’s the flow.

If this answer helped solve your issue, feel free to mark it as the solution so others can benefit from it too!

Best,

Robert

1 Like

Here’s one more way as well. Without code blocks.

2 Likes

Fantastic!! Thanks so much.

1 Like

Glad to help!. feel free to mark one as the solution so others can benefit from it too!

1 Like

Ahh, I missed the Solution button. Done now. Thanks again. I have bruises on my forehead from banging my head on the desk over this before your help!

1 Like

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