# Pre filter an embedded dashboard

**URL:** <https://community.grafana.com/t/pre-filter-an-embedded-dashboard/27780>\
**Category:** PostgreSQL\
**Tags:** postgres, templating\
**Created:** [March 27, 2020, 1:43pm UTC](https://community.grafana.com/t/pre-filter-an-embedded-dashboard/27780 "2020-03-27T13:43:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![yanbled](https://avatars.discourse-cdn.com/v4/letter/y/ee7513/32.png) [@yanbled](https://community.grafana.com/u/yanbled)\
**Post date:** [March 27, 2020, 1:43pm UTC](https://community.grafana.com/t/pre-filter-an-embedded-dashboard/27780/1 "2020-03-27T13:43:53Z")

</div>

Hello,  
Sorry for my english,  
I have a web application where i embed iframe of grafana dashboards,  
I would like to give some parametres to the iframe that it will filter the data of the panels based on these parameters, for exemple filtring the dashboard to show data only of a selected departement (departement of the user wich is connected to the web application for exemple ) , i think we can do that by creating variables (template dashboard) and then setting them in the url of the iframe dirrectly in the html, is there another “clean” way to do that ?  
And if we consider we can do that, how can i prevent the user to remove this filter because i dont want him to see the issues of the other departements ( of course with letting him setting the other filters ).  
Thanks for your help  
Best regards

---

<div class="post-metadata">

**Author:** ![aleschinsky](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@aleschinsky](https://community.grafana.com/u/aleschinsky)\
**Post date:** [March 10, 2021, 3:17am UTC](https://community.grafana.com/t/pre-filter-an-embedded-dashboard/27780/2 "2021-03-10T03:17:07Z")

</div>

Hey, did you figure out how to do this? I’m considering using Grafana in the same way.

---

<div class="post-metadata">

**Author:** ![cliffordfajardo](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/cliffordfajardo/32/25322_2.png) [@cliffordfajardo](https://community.grafana.com/u/cliffordfajardo)\
**Post date:** [August 18, 2022, 11:29pm UTC](https://community.grafana.com/t/pre-filter-an-embedded-dashboard/27780/3 "2022-08-18T23:29:20Z")

</div>

I’m also very curious if there is an official way of doing this.  
Like the original poster described, the first method that comes to mind (though feels hacky)  
is to update the embed URL in the app that’s hosting the embed - that should trigger a request to fetch the new data - I’m worried about the user experience though

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [August 18, 2022, 11:59pm UTC](https://community.grafana.com/t/pre-filter-an-embedded-dashboard/27780/4 "2022-08-18T23:59:18Z")

</div>

Welcome

Why is grafana embedded? if you want user to only see a specific set of data you can do this via ACL

See this

> [@Limit users to access Variable values](https://community.grafana.com/t/limit-users-to-access-variable-values/8513/13):
>
> It looks like that variable does exist based on the above here is an example with sample ddl & dml use grafana --this is my own ms sql server database --for testing things out not grafana's db go drop table companies create table companies(companyid int identity(1,1), companyname varchar(50) ) insert into companies select 'Acme' union select 'Zimza' drop table users; create table users(username varchar(50)) insert into users select 'ddenson' drop table usercompanies create table …

---

<div class="post-metadata">

**Author:** ![cliffordfajardo](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/cliffordfajardo/32/25322_2.png) [@cliffordfajardo](https://community.grafana.com/u/cliffordfajardo)\
**Post date:** [August 22, 2022, 3:11pm UTC](https://community.grafana.com/t/pre-filter-an-embedded-dashboard/27780/5 "2022-08-22T15:11:28Z")

</div>

> Why is grafana embedded?  
> We would like to display certain dashboards in one of other custom web UI applications so our non-grafana / novice grafana users don’t need to visit our grafana dashboards.

Other pros of embedding in my opinion, you can have your stakeholder users visit one web app interface instead of switching between 2 or more; we’re wanting to created a unified web experience.

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [August 22, 2022, 3:18pm UTC](https://community.grafana.com/t/pre-filter-an-embedded-dashboard/27780/6 "2022-08-22T15:18:31Z")

</div>

> [@cliffordfajardo](#):
>
> if there is an official way of doing this

basically there is no “official way” of doing this. Just implementing it via your basic iFrame.

---

<div class="post-metadata">

**Author:** ![cliffordfajardo](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/cliffordfajardo/32/25322_2.png) [@cliffordfajardo](https://community.grafana.com/u/cliffordfajardo)\
**Post date:** [August 22, 2022, 4:34pm UTC](https://community.grafana.com/t/pre-filter-an-embedded-dashboard/27780/7 "2022-08-22T16:34:07Z")

</div>

I created another thread with an image describing the scenario  
Thread “[How to expose filters to grafana embed](https://community.grafana.com/t/how-to-expose-filters-to-grafana-embed/70920)”?

Someone else suggested the following, which I’m going to explore later:  
“_One option would be to create a custom panel plugin which has the options as part of the panel itself_”
