Can’t use Retool configVars in BigQuery table name

,

Hi everyone,

I’m trying to run a BigQuery query where the project and dataset are stored in a config variable. Here’s what I have:

select * from {{ retoolContext.configVars.dataset_bq }}.phone_contact_with_user_id limit 10

The variable dataset_bq contains jota-prod.public. When I run this query, I get the error:

Query parameters cannot be used in place of table names at [1:16]

I’ve confirmed that manually writing the full table path like this works:

select * from jota-prod.public.phone_contact_with_user_id limit 10

I also tried variations like breaking it into two variables (project_id and dataset), using transformers, and even JS queries to build the table name — none of them seem to work with BigQuery via Retool.

Is there a known workaround or a recommended way to use dynamic table names in BigQuery queries?

Thanks in advance!

Hi @Tiago_Guilhon ,
Does this thread help you? You could try disabling prepared statements for your resource, but be cognizant of the dangers of doing so mentioned in this thread.

Let me know if this works for you!