Skip to main content
Question

How do I create a Google Sheets rows from JSON text string?

  • May 11, 2024
  • 1 reply
  • 135 views

It doesn’t matter where it comes from but in the case I am using the MindStudio AI which sends a text response formulated as a single JSON string such as :

```
[{“ColumnA”:”ValueA1”,“ColumnB”:”ValueB1”},{“ColumnA”:”ValueA2”,“ColumnB”:”ValueB2”}]
```

How do I take this and create the two rows in Google Sheets? Do I need to loop?

 

I’m able to have it start with a different format if required.
 

I was also looking at this but it’s not clear to me how this works: https://help.zapier.com/hc/en-us/articles/8496275165709-Create-line-items-in-Zaps#h_01HJ1CTEWMZ42KSY0XQXF2D5QN

Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

SamB
Community Manager
Forum|alt.badge.img+11
  • Community Manager
  • 7487 replies
  • May 14, 2024

Welcome to the Community, @alanwunsche! 🎉

I expect you’d need to use a Code by Zapier action step to convert the JSON into the necessary line items. Then, instead of using a Looping by Zapier action, you can use a Create Multiple Spreadsheet Rows (Google Sheets) action to add a new row for each line item output by the Code step. 

I can’t provide the specific code but we do have an AI-powered Code steps feature you could use to help generate the code for you! You can learn more about this here: Generate a Code step using AI (Beta)


Hope that helps to get you pointed in the right direction. If you run into any issues on that or have further questions just let us know!