Dashboard variable that is set from an autocomplete query against database table

Let’s say you have a table that lists your tenants and their id.
We want to add a variable that allows a user to pick a tenant, but we want the query to be filtered by text entered by the user so we don’t pull the whole list of tenants all of the time.

Let’s say the query is like this now, is there a way to make it autocomplete based on what the user types in. It should only return maximum 10 items, and it should only return items after user has entered at least one character into the text box.

For example, the query could be this right now, what would it look like with filtering? Is there a way to do it without having a separate “filter” variable on the dashboard?

SELECT id, name
FROM Tenants
ORDER BY name

there is no such a feature of autocomplete. the next best thing is doing a query based on what the user entered


SELECT id, name
FROM Tenants
where name like '%user_entry%'
ORDER BY name