Help Needed with Connecting Bubble.io to BigQuery via SheetDB

Hi Bubble community,

I’m working on a Bubble.io app where users can enroll in a course to learn SQL. I have a static dataset in Google Sheets which is connected to BigQuery. Here’s what I’ve done so far and where I need help:

What I Have Done:

  1. Google Sheets Connection:
  • I have my dataset in Google Sheets.
  • The Google Sheet is connected and synced with BigQuery.
  1. SheetDB Integration:
  • I’m using SheetDB to interact with my Google Sheets.
  • I have the SheetDB API endpoint: https://sheetdb.io/api/v1/rghizq7f7rbny?search?ID=<condition> which I have linked into API Connector
  1. Bubble.io Setup:
  • I created an input field for users to enter SQL queries.
  • I added a button to trigger query execution.
  • I wrote JavaScript to parse the SQL query and extract the condition from the WHERE clause:
var query = document.getElementById("input_QueryInput").value;
var condition = query.split("WHERE")[1].trim();
condition = condition.replace(/AND/g, "and.")
                     .replace(/OR/g, "or.")
                     .replace(/>/g, "gt.")
                     .replace(/</g, "lt.")
                     .replace(/=/g, "eq.")
                     .replace(/\bBETWEEN\b/g, "and.");

// Trigger the custom event to set the parsed condition
bubble_fn_setParsedCondition(condition);

What I Am Trying to Do:

  • I want to execute the parsed SQL query against my Google Sheets data via SheetDB.
  • Fetch the results based on the condition.
  • Display the results in my Bubble.io app.

Where I Am Stuck:

  1. Executing the Query:
  • I need help setting up the workflow in Bubble.io to send the parsed condition to the SheetDB API and fetch the data.
  • How do I properly configure the API call in Bubble’s API Connector (if not already done correctly)?
  1. Displaying the Data:
  • Once the data is fetched from SheetDB, how do I display it in a repeating group or any other suitable element in Bubble.io?

Any guidance on setting up the API call in Bubble.io and displaying the fetched results would be greatly appreciated!

Thank you in advance for your help!

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.