Assigning values to filters or hiding them via the URL is not working

I tried to add filters to a public link via query params http://localhost:3000/public/question/dddceba5-707f-89-8b12-24b1c00cbca1?Status=active. The filter is not getting applied on it

Hi @manuvakery
Please post "Diagnostic Info" from Admin > Troubleshooting.
I don't understand what you mean - can you provide more context?
Are you sure the name of the filter is not lowercased status ?

Hi @flamber
This is a public URL for a question http://localhost:3000/public/question/dddceba5-707f-89-8b12-24b1c00cbca1. This can be accessed from anywhere and its working well. Now I wanted to add a filter via query param, say http://localhost:3000/public/question/dddceba5-707f-89-8b12-24b1c00cbca1?Status=active I don't see any changes in the result. I am getting rows which has other Status too. yes the name of the filter is Status. Logs looks fine

@manuvakery

I'm not asking for logs. I'm asking for "Diagnostic Info" from Admin > Troubleshooting.

You have to create filters on the dashboard. If the name of the filter is Status, then the parameter should be status.
I would recommend that you have a look here:
https://www.metabase.com/docs/latest/users-guide/08-dashboard-filters.html

Can you put question filters in the URL? I looked at that ages ago and couldn't figure out how to get it to work. I've used dashboard filters as described in the link from @flamber yes but not questions. If this works then I'll be super happy, this would be a great addition.

@flamber. Thanks for your reply. I am able to make it work with a dashboard. But like @notrom mentioned if we can have similar functionality for a question, it will be great. Anyway I am sorted for now

Also, the doc here says the filters can be applied for a dashboard or question via query param.

It only works for explicit filters (like the ones created on dashboard or Native query), so if you are referring to questions built in GUI, then those filters are not exposed.
Or am I misunderstanding what is being asked?

@flamber I've searched but can't find it, is there an existing GitHub ticket for question filtering via URL? It really would be a great addition.

@notrom There might be some permissions concerns with allowing filtering on implicit columns. My brain is still trying to wrap around how I could exploit that. But I don't remember seeing a request for that.

@flamber Can we create a filter with email in the dashboard? email is not listed in the column to filter on dropdown

@manuvakery Change the type to Category: https://www.metabase.com/docs/latest/users-guide/13-sql-parameters.html#creating-sql-question-filters-using-field-filter-variables

@flamber I changed the type to Category but still, the email column is not coming in the dropdown. I am able to choose all other columns for filtering except email

@manuvakery

  1. Post "Diagnostic Info" from Admin > Troubleshooting
  2. How many distinct values do you have in the column?
  3. What's the filtering option set to in Admin > Data Model > (db) > (table) > (column) :gear: ?

@flamber
1.

{
  "browser-info": {
    "language": "en-GB",
    "platform": "Linux x86_64",
    "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.11+9",
    "java.vendor": "AdoptOpenJDK",
    "java.vendor.url": "https://adoptopenjdk.net/",
    "java.version": "11.0.11",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.11+9",
    "os.name": "Linux",
    "os.version": "3.10.0-1160.15.2.el7.x86_64",
    "user.language": "en",
    "user.timezone": "UTC"
  },
  "metabase-info": {
    "databases": [
      "h2",
      "mysql"
    ],
    "hosting-env": "unknown",
    "application-database": "h2",
    "application-database-details": {
      "database": {
        "name": "H2",
        "version": "1.4.197 (2018-03-18)"
      },
      "jdbc-driver": {
        "name": "H2 JDBC Driver",
        "version": "1.4.197 (2018-03-18)"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2021-04-27",
      "tag": "v0.39.1",
      "branch": "release-x.39.x",
      "hash": "6beba48"
    },
    "settings": {
      "report-timezone": null
    }
  }
}
  1. There are almost 500 values in that column
  2. Filtering on this field is set to Searchbox

@manuvakery

  1. Migrate away from H2 if you are using Metabase in production:
    https://www.metabase.com/docs/latest/operations-guide/migrating-from-h2.html
  2. I think the new limit is now 1000 - it used to be 300 and then dropdowns were shows as a weird combination of search
  3. Well, if you want a dropdown, then change it to "A list of all values" instead of "Searchbox", but you'll be hit by this regression, which limits to 100:
    https://github.com/metabase/metabase/issues/15695 - upvote by clicking :+1: on the first post

@flamber thanks a lot for your help