Flutter Flow: Write to Google Sheets Custom Action
There are amazing integrations to send data to backend services like Firebase, Supabase, and any API. In this article I want to show you how to write to Google Sheets using a custom action.
Setup
We are going to use the package gsheets for this example. You can get the latest version here:
gsheets install | Dart package
A library for working with Google Sheets API v4. Manage your spreadsheets with gsheets in Dart.
The package mentions following this article for the Google Sheets API access:
How To Get Credentials for Google Sheets
In this tutorial, I’m going to show you how to get credentials for working with Google Sheets (step by step with…
There is one minor change when getting the key. It ask you to create it before creating the service account. After creating the service account, it will take you to the credentials page again. Click on the service account and go to the Keys tab. You can create your key in JSON format there.
Creating your custom action
In Flutter Flow, go to the Custom Code tab and click Add > Action
Give the action a name. Remember it has to match the function name in the code.
On the bottom right add the gsheets dependency.
gsheets: ^0.5.0
Note the version may change, which you can find here
Now add the following code:
Keep reading with a 7-day free trial
Subscribe to Coffee Bytez Substack to keep reading this post and get 7 days of free access to the full post archives.