Newb help: Setting up Bubble app with Coda API

At the risk of embarassing myself in from of my fellow Codans, I’ll go ahead and ask a super newby no-coder question.

I’m attempting to get all names, last names and emails to sync (one way) of one of my Coda docs into a Bubble app I’m working on.

I set up an API that restrics to Read Only. I’ve set up my Bubble App API like this:

When I initialize the call, it get a 404 Not found message.

I’ve gone through quite a bit of docs and videos but don’t know what I’m doing wrong. A little help or guidance would be awesome.

Thanks guys!

Never used bubble, but it looks like you’re just GET-querying the base URL, not the actual URL of your resource. That’s first.

Second, a doc name is not a doc ID. Doc IDs look like _dXXXXXXXXXX, where XXXXXXXXXX is a 10-char combination of digits and letters.

Third, that’s not even used in this request in the screenshot, I believe. I assume the key-value pairs are something that bubble renders as a JSON to send in request body, but GET requests don’t have a body.

2 Likes

Hey Paul, thanks for your help as always! I got it working and am pulling data as I request it.

In your experience, what’s the best practice to use CODA API? I want to sync the “status” of my 400 customers into my bubble app (Either “Active” or “Inactive”).

Should my bubble app make an API call with each customer entry? Not sure what the best practice is here

Frankly I never worked with Coda API directly. But I think querying 400 customers with 400 separate requests could be quite redundant, no? I believe Coda supports querying multiple rows in a single query.

I could tell more if I knew what exactly you were trying to accomplish. There was only one project where we used Coda + bubble with a client, and in that project we weren’t using Coda as a data source, but only as an admin panel to prepare and upload data into MySQL on AWS. That MySQL database was the data source, which bubble then used to display data to end users.

In your case if it is only the active/inactive that you want to sync, I don’t think you need an external DB for that. But how fresh do you need your data to be? Because there are multiple ways:

  • Query all users with their statuses e.g. once a day from Coda and store it in bubble’s database (I believe it has one) — fewer requests to Coda hence faster, but recently deactivated users will still be treated as active
  • Or query that specific user’s status from Coda every time the user starts their session or does something sensitive in bubble — gives most recent data but slows down loading
  • Anything in between these two extremes
1 Like

That sounds like a fun project (the aws and mysql and bubble).

I think once a day (or even once a week) would work well. I would just need the status column. I’ve been trying to get that column’s value with:

https://coda.io/apis/v1beta1/docs/{docId}/tables/{tableIdOrName}/columns/{columnIdOrName}

But just get info about the column itself. Any idea how?

I think it makes sense to just call for all data of users then store them in the DB.

Yep, that request returns info about a column, not the column values. Values are stored per row, hence you need to query rows.

You can make a view of your table with only user identifier and status columns, and query that view with https://coda.io/developers/apis/v1beta1#operation/listViewRows

and read values of each row’s status column that you locate with a column ID.

See on the right the sample response for 200 OK status.


P.S. That was a pretty fun project alright… Not as fun as the ones that followed though, lol.

1 Like

Newb question (like all my questions :rofl:)… how can I get the view ID?

image

And for column IDs:

And if you don’t see those, enable Developer Mode by going to https://coda.io/account -> scroll to the very end to Labs

1 Like

Yours seem to have super powers! Mine doesn’t show the id

Yeah, I figured. See my last edit:

1 Like

Awesome awesome awesome as always Paul, thank you so much!!

1 Like