How to connect dropdown control to custom query parameter?

OS7
Bronze 1
Bronze 1

Hi everyone,

I'm trying to create a dynamic reporting setup where:
1. Query A fetches a list of client names from BigQuery
2. Display those names in a dropdown control
3. Pass the selected client name to Query B via @SELECTED_CLIENT_NAME parameter
4. Query B dynamically executes with the filtered data

**Sample Queries:**

Query A (for dropdown options):

```sql
SELECT DISTINCT client_name
FROM `project.dataset.clients_table`
ORDER BY client_name
```

Query B (main data with parameter):
```sql
SELECT
client_name,
revenue,
sessions,
DATE(@DS_START_DATE) as start_date,
DATE(@DS_END_DATE) as end_date
FROM `project.dataset.analytics_table`
WHERE client_name = @SELECTED_CLIENT_NAME
AND date BETWEEN @ds_START_DATE AND @ds_END_DATE
ORDER BY date DESC
```

**Current Issue:**
- I've created the @SELECTED_CLIENT_NAME parameter in my data source
- However, I can't find a "Parameter" option in the dropdown control settings
- The dropdown setup only shows: Data Source, Control Field, Metric, Filter, Date Range Dimension, Sort
- My parameter currently appears as a text input field instead of being populated by Query A results

**Expected Behavior:**
Just like @ds_START_DATE/@DS_END_DATE work with date range controls to avoid loading massive datasets upfront, I want @SELECTED_CLIENT_NAME to work with dropdown control for dynamic query execution.

**Questions:**
1. How do I properly connect a dropdown control to a custom parameter?
2. Is it possible to populate dropdown options from one query and use the selection in another query's parameter?
3. Am I missing a step in the parameter-control linking process?

Any help would be greatly appreciated! Thanks in advance.

Solved Solved
0 2 513
1 ACCEPTED SOLUTION

@OS7 

Unfortunately, for the moment, dynamic parameters (fed by data sources or any dynamic logic) are not available in Looker Studio.

So the mechanism with a bridge you are trying to build is not possible.

you need to adapt the data model to merge the data sets of query A and query B in the same data source (as example left joining query A with query B), and use "client_name" as a simple filter control.

I hope it helps.

View solution in original post

2 REPLIES 2

@OS7 

Unfortunately, for the moment, dynamic parameters (fed by data sources or any dynamic logic) are not available in Looker Studio.

So the mechanism with a bridge you are trying to build is not possible.

you need to adapt the data model to merge the data sets of query A and query B in the same data source (as example left joining query A with query B), and use "client_name" as a simple filter control.

I hope it helps.

OS7
Bronze 1
Bronze 1

Hi @Mehdi_Oudjida ,

Thank you so much for your clear and helpful response!

I really appreciate you taking the time to explain that dynamic parameters fed by data sources aren't currently available and for suggesting the alternative approach of merging datasets and using a standard filter control. This clarifies why I wasn't finding the "parameter" option in the dropdown settings as I initially expected based on how @DS_START_DATE works.

Your explanation about adapting the data model to LEFT JOIN Query A with Query B and using "client_name" as a simple filter control makes perfect sense. I understand now that this is the standard way to achieve the kind of interactive filtering I need.

I'll proceed with modifying my data source (Query B) to include the client name for filtering and then use the dropdown control to filter on that field, rather than trying to pass a value to an @parameter directly from the dropdown.

Thanks again for guiding me in the right direction! This is a great help.

Best regards,