Field Filter with dropdown and new choice options

Hi!
I have a question which queries a view I created in our DB (postgresql). View has data about user attribution (source, country etc) and some payment stats about the user. Each row - one user. The problematic use case is the following: we need to be able to select users from all countries and in the same question we need to be able to choose users from several countries. In separate instances of question usage, of course.
Right now we do it like this: we have a drop-down field filter connected to country_code field. We have around 90 countries in the table, all of them are selected by default.
Problems:

  1. In order to select all countries during question usage, user can only refresh the webpage to roll back to default filter settings. According to this thread there's no way to select all options in dropdown. Selecting 90 countries manually is a pain. Maybe there's a workaround here?
  2. If there's no workaround, another problem pops up. The data is expanding and we get users from new countries. They appear in the view as new users. They are visible in metabase. But there's a problem with filter
    2a) I have to run a field scan manually to push new countries to the filter. According to this thread such scan happens automatically once a day. I wasn't able to automatically get new countries to the filter. Can you confirm this auto-update is a thing or hint to where I can check it in admin?
    2b) When the new country arrives to the filter, our default selection of all countries does not include this new country. So if a new country is added, I need to notice it, go into the question, put a tick near the new country. Is there a way to always select all filter choices as default?

Overall, I would appreciate a general advice on fixing this use-case we have.

Hi @GKM364

Post "Diagnostic Info" from Admin > Troubleshooting.

I'm not sure I understand why you are selecting all options by default. If you don't set the filter, then it will show all results by default.

Select/deselect all options:
https://github.com/metabase/metabase/issues/21600 - upvote by clicking :+1: on the first post

You can change the scan period:
https://www.metabase.com/docs/latest/administration-guide/01-managing-databases.html#choose-when-metabase-syncs-and-scans
Or do it manually via the API:
https://www.metabase.com/docs/latest/api/notify.html

If you need the filter defaults to change, then you would have to update the question (card) or dashboard filter via the API:
https://www.metabase.com/docs/latest/api-documentation.html

1 Like

Not choosing a filter is an option I didn't think about and it solves the case. I'm relatively new to Metabase, sorry :slight_smile:
Thank you!

@GKM364 It's probably the easiest to think of Metabase as a SQL helper, if you are familiar with SQL.
When you set a filter, then Metabase does a WHERE column = 'something', but when you don't set the filter, then there won't be any WHERE-clause. Same for joins etc. There's only a few places where Metabase does things that isn't translatable to SQL, which usually means it's done internally in code.