How to use a text field to set the query for BigQuery

  • Goal: I built the below in an app, where the user would input a SQL query into a text component and then trigger it manually to get data from our Postgres database.


    I has worked well, but now we are trying to use a similar but improved database but it lives in our BigQuery Data Warehouse. I tried using the same method, but it no longer works.

  • Steps: (As recommended by ChatGPT :sweat_smile:) I've tried to use various ways to write the SQL code, but it always goes back to that same error. I believe because BigQuery just doesn't allow referencing? Or am I missing something?

  • Details: We're cloud-hosted and I'm pretty sure we are on the latest version. This is in a multi-page app though. All testing done on the page level, in case that is relevant.

Appreciate any help! I have found a temporary workaround, but would like to understand nonetheless what I'm missing here.

Are both queries configured to have prepared statements disabled? My thought is that the old resource was setup to have them disabled but perhaps the new one didn't have the box checked when it was created.

That worked! Thank you so much!

1 Like