Filters in an Embeeded Application

I have a question regarding embedding dashboards in our web application (we are using Metabase v0.47.6 in our server)

We created a dashboard with 5 Filters as shown below :
image

I left all filters configured as Editable when published it, and our code include the Parameters when necessary. In fact, we are including only the “Empresa” filter (meaning the customer) in the payload block :

var payload = {
resource: { dashboard: 3 },
params: {
"empresa": "2"
},
exp: Math.round(Date.now() / 1000) + (10 * 60) // 10 minute expiration
};
var token = jwt.sign(payload, METABASE_SECRET_KEY);

var iframeUrl = METABASE_SITE_URL + "/embed/dashboard/" + token + "#bordered=true&titled=true";

When we do that (I mean, defining this parameter in the payload) , the corresponding filter do not appear in the dashboard, and that’s fine.

But there are cases where I want to provide the “Ano” (Year) as a preconfigured filter, but when I send it as a Parameter, the dashboard hides the filter “Ano”.

Is there a way to keep it appearing in the dashboard but giving an “entry” value (for example, I want to initiate with year 2024) and leave it unblocked to be redefined in the dropdown filter?

Thanks for your help !

Hey there, have you guys tried to set a defaulted value from the UI for the “Ano” field?

Hi Roberto
Yes we did. The result is that the filter is applied, but we can not change the filter value because the filter "Ano" is hidden and the idea is to give flexibility to the user selecting another "Ano" value.

You set the default in the dashboard, not the embedding settings.

1 Like

Hi Roberto and Andrew

Now I got it ! I set the default valeu for the field "Ano" and it worked. Thanks for your help.

Gerson.