Today I start my second month on Bubble. It has been an amazing experience so far. Suddenly everything seems possible. But I’ve also hit a wall with Google Sheets API and it would be great if you could help me. Apologies in advance for any misuse of terminology.
Bigger picture, I’m interested in Bubble for APIs generally and I’d like to master them. I know there are plenty of 3rd parties which easily do the job, I’d still rather learn how APIs work.
Smaller picture, I’m trying to create an interface for my current employer so they can read and write to their multiple (20+) Google Sheets without going in and out of each doc. The data are simple order data (supplier, order number, materials etc.) all in neat columns and rows.
Test 1: sheetdb.io
In my initial MVP, I integrated with a few Google Sheets aps and got exactly where I wanted to be with sheetdb.io. It’s very easy and I’d recommend it if you’re happy with a third party solution, or just to test. Here’s how I see it up with sheetdb.io in plugins:
The full call looks like this:
The queries allow me to search the sheet by column. For example, if I add a further query &OrderedBy=[query] I would also be able to search who ordered items once the app is live.
And here’s the repeating group set-up in design:
And for the cell data in the repeating group I just added a text for each column and connected it to the sheet with this:
It really was that simple. I pulled in all the data I wanted from the sheet and even added a simple search input which works way better than Google sheets. No work-flows btw.
Test 2: Google sheets API
This test was by no means as successful although connecting to Google sheet’s API was also remarkably simple. If you haven’t done so already, I followed the following steps:
On Google Cloud Platform / Google Sheet
- Create a developer account at https://console.cloud.google.com/
- Set up keys. I’m only reading data so far so only set up the client key and that seems to work fine.
- Choose which services you want to interact with (in my case, Google Sheets) from the console library and enable them.
- Change the settings of the Google sheet you want to interact with to “shared” (top right of the page) and share it with the email that appears at the bottom of the ‘credentials’ page back on Google console.
On Bubble
- Install Bubble’s generic API connector.
- Create an API for Google within the API connector. That’s literally just a case of ‘Add another API’ and calling it ‘GoogleCloud’ (the name is not important as far as I know).
- Set-up the call.
I set the call up as follows:
When run, the call reads the spreadsheet fine and the raw data (linked at the bottom of the call results) shows the entire data from the sheet.
I can also access the data from Bubble including individual rows, albeit randomly, from here:
But I can’t recreate the sheets.db integration in 2 important ways (possibly connected):
-
I can’t recreate the repeating group as I did with sheetdb.io. It’s not clear to me which ‘type of content’ and ‘database source’ to use in the repeating group nor which calls to make from the cells.
-
I haven’t managed to extract the values &Supplier=[query]&Costs=[query]* as I had in the sheetsdb.io version. I imagine I’ll need that when I come to search the data later on the live app.
What am I missing? Is sheetsdb.io and others preprocessing the data somehow or is it something more obvious than that.
Thank you in advance for your help. I’m obviously a complete newbie so I can’t offer much in return, for now, although I hope this post has been useful for some.