Use results from query to define category type field filter dropdown list

I am writing query in MySQL that gets ‘service name’ for an organization.

I want to filter by ‘service name’ but field filter category type will show all services in the service table, not only services available to the organization. How do restrict the available service names in the dropdown list to the organization in the query only?

Hi @ChristineChetty
Probably the most asked question in the forum - do a search for possible workaround by creating your own embedded dashboard, where you control the filters in your application.
https://github.com/metabase/metabase/issues/5540 - upvote by clicking :+1: on the first post

1 Like

Further issue is that field filter syntax is not working:
I am not sure what is wrong with this statment

@ChristineChetty Because you cannot use table aliases with Field Filters:
https://www.metabase.com/docs/latest/users-guide/13-sql-parameters.html#the-field-filter-variable-type
https://github.com/metabase/metabase/issues/3324 - upvote by clicking :+1: on the first post

Does this mean I cannot have aliases anywhere in my query at all?

Can you provide an example where a field filter can be used, because I have removed all aliases from my query and still having a problem

@ChristineChetty Post your query. You can use aliases for anything besides the tables that you’re using in Field Filters, since Metabase inserts the reference code and doesn’t understand that you have aliased the name.
If you read the documentation, then you’ll see this noted and a few examples. If you search the forum, then you’ll find many examples.

1 Like