Dropdown filters display as text fields once embedded

Hi,

We're experiencing and issue where filters that are set as dropdowns in the Metabse UI are displaying as text fields when embedded in our app.

This is happening to multiple filters, but not to all of them. Additionally, one of the dropdown filters shows one option when there should be four.

Here are screenshots of the two scenarios:

We have tried:

  • Clearing the field caches in Admin > Table Metadata
  • Adding custom values to the dropdown list
  • Changing the table type to ENUM instead of Category
  • Unlocking the Locked filter

Further details:

  • Database: Postgres
  • Embedding method: Python

Strangely it seems that the API actually returns an empty array for the filter values:

Entering a value that exists into the filter does work and results are filtered accordingly.

Diagnostic info:

{
  "browser-info": {
    "language": "en-ZA",
    "platform": "MacIntel",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.24+8",
    "java.vendor": "Eclipse Adoptium",
    "java.vendor.url": "https://adoptium.net/",
    "java.version": "11.0.24",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.24+8",
    "os.name": "Linux",
    "os.version": "5.15.0-1053-aws",
    "user.language": "en",
    "user.timezone": "GMT"
  },
  "metabase-info": {
    "databases": [
      "postgres",
      "h2"
    ],
    "hosting-env": "unknown",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "16.1 (Debian 16.1-1.pgdg120+1)"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.7.3"
      }
    },
    "run-mode": "prod",
    "plan-alias": "",
    "version": {
      "date": "2024-08-13",
      "tag": "v0.50.20",
      "hash": "df82d58"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

Thanks in advance for your time!

Do you have any linked filters associated with these drop down filters?

Also are those Questions in the Dashboard SQL questions, GUI questions and are they based on models, other questions or tables. Can you share some screenshot of that setup.

I would start by having a dashboard with just 1 question first and then link the appropriate filters so its easier to debug. It could be 1 question is interfering with all the other questions int he dashboard

Hey Tony,

Thanks for your response!

No, we do not have any linked filters.

These are all SQL questions. I am not sure exactly what you'd like to see a screenshot of in regards to that?

This same thing is actually happening in another app of ours that embeds from a different instance of Metabase.

What is very strange here is that the Metabase API actually returns an empty array for the affected filters and those filters work if an appropriate value is manually entered.

yeah my assumption is that metabase is simply not able to detect the proper column. Do you have a lot of joins around the field filter you are using and are these FKs properly mapped in the Admin -> Table Metadata

So i would start with removing all cards and just leave 1 and see if that happens for just 1 card then start adding back 1 card at a time. It could be 1 card (question) is the problem. Can you try please

Hey Tony,

Ok, we have mad a very basic dashboard with a basic query and only two filters and the issue persists.

Here is the Metabase dash showing the two filters and the status filter correctly populated:

Here is the embedded view showing the status filter with only one of three options (in other cases this shows as a text field):

I think we have narrowed it down to a specific scenario though.

Our app is a 'multi-tenanted' app with multiple organisations and we pre-filter results per org by dynamically passing in the org param via the backend. We make the org filter a locked param in the embed settings (screenshot below).

Making the org filter Editable in the embed settings doesn't make any difference.

If we remove the org filter from the query then the embedded version gets all the dropdown options.

Here is how we are handling the param injection via the backend:

Thanks for your time!

Hey,

Just bumping this topic. Should I create a bug on Github for this perhaps?