How to update Google Sheets with JSON API
Tags: nocode, tutorial
Published: 2020-05-26 13:49:32

---
title: How to update Google Sheets with JSON API
published: true
date: 2020-05-21 23:39:05 UTC
tags: no code, tutorial
canonical_url: https://maxkatz.org/2020/05/21/how-to-update-google-sheets-with-json-api/
description: A short tutorial on how to update Google Sheets with JSON API
---

Google Sheets is a well-known service and online spreadsheet. Google Sheets can be more than just a spreadsheet, it can be used as a back-end or a database for applications. For example, [Glide](https://www.glideapps.com/) uses Google Sheets as a database for its mobile applications. Glide allows to build a mobile application without any code connected to Google Sheets. It’s incredible how fast you can build a real app, .

I was building an app in Glide that displays the latest news using [News API](https://newsapi.org/). I connected the app to a Google Sheets spreadsheet where I entered a number of news stories manually. The app looks like this:

![](https://katzmax.files.wordpress.com/2020/05/googlsheets-api-glide.png?w=576)<figcaption>Glide app</figcaption>

This is how the Google Sheets spreadsheets looks:

![](https://katzmax.files.wordpress.com/2020/05/googlesheets-api-data.png?w=1024)<figcaption>Data for Glide app in Google Sheets</figcaption>

If I need to update any news I can manually edit the Google Sheets spreadsheets and the Glide app will be updated.

This manual update is not ideal of course.

I wanted to see if there is a way to consume an API form Google Sheets and update the spreadsheet. One way is to add a [script to Google Sheets](https://medium.com/unly-org/how-to-consume-any-json-api-using-google-sheets-and-keep-it-up-to-date-automagically-fb6e94521abd). I wanted to see if there is way to achieve the same result using no-code tools. I went back to [Parabola](https://dev.to/maxkatz/parabola-watson-nlu-news-api-and-twilio-tools-i-used-to-build-a-no-code-application-4k3k) and created a flow that calls a REST API and updates a Google Sheets document.

The flow looks like this:

![](https://katzmax.files.wordpress.com/2020/05/gogolesheets-api-flow.png?w=1024)<figcaption>Parabola flow to invoke an API and export the result to a Google Sheets spreadsheet</figcaption>

Let’s look at each step.

The **API Import** step invokes an external REST API. In this example I’m using News API service.

![](https://katzmax.files.wordpress.com/2020/05/googlesheets-api-import.png?w=1024)<figcaption>API Import step</figcaption>

The next step is **JSON Flattener**. This steps take the API response and puts it in columns/rows format. Below we are specifically flattening the _articles_ column.

![](https://katzmax.files.wordpress.com/2020/05/googlsheets-api-flattener.png?w=1024)<figcaption>JSON Flattener step</figcaption>

The **Column Filter** step is optional. It allows to remove columns that we don’t need in Google Sheets spreadsheet. Instead of removing columns you can specify which columns to keep as shown below.

![](https://katzmax.files.wordpress.com/2020/05/googlesheets-api-filter.png?w=1024)<figcaption>Column Filter step</figcaption>

The last step, **Google Sheets Export** exports the data to a spreadsheet.

![](https://katzmax.files.wordpress.com/2020/05/googlesheets-api-googlesheets.png?w=1024)<figcaption>Google Sheets Export step</figcaption>

When the flow is run it first gets the latest news from News API and then exports the result to Google Sheets. I like that this is a no-code approach. We are updating a Google Sheets spreadsheet with JSON from an external API. You can also look at as consuming an API from Google Sheets.