Question

Pass filter parameters to public iframe source urls?

  • 18 March 2016
  • 9 replies
  • 910 views

Is there a way to dynamically pass filter values for public tables and visualizations that are embedded via iframe?


e.g. I’d like to embed a visualization with two filters: city and gender.


On one page of my public website, I’d like to filter the city to NYC and the gender to male, so I’d want the source url for my iframe to be something along the following lines: mylookerinstance.com/looks/sjdbcjdbjAnDnXnE?cityfilter=NYC&genderfilter=male


On another page, I’d want the embed to show data where city is Cincinnati and gender is female, so it would look like this:

mylookerinstance.com/looks/sjdbcjdbjAnDnXnE?cityfilter=cincinnati&genderfilter=female


9 replies

Userlevel 5
Badge

@rtblair it isn’t currently possible to modify a public Look by changing URL parameters, since this would change what making a Look public means. If you could modify the query with URL parameters, making a Look public would basically mean making the entire explore public. In your case, I would recommend making two public Looks and using them where you need them. But I’ll also make sure our product team sees this use case!

+1 on this feature request… In my case, i’m not trying to make the whole explore public, just want to allow filters that are already part of the saved look editable from the url.

Userlevel 2

Hi @daking13,


Thanks for making us aware of your use case, I will loop in our Product team about it!


Cheers,

Vincent

+1 from me as well; could make Looker.com into my microservices engine for data access and analysis

Userlevel 2

Hi @dcmsjc,


Thank you for your comment. I’ll pass it to our product team on your behalf.


Best,

Aleks

Not sure if this is the same thing for me but I will chime in with my use case. Im new to Looker so I apologize for the ignorance.


I have a dashboard that I am embedding for view only. The dashboard uses a user attribute based filter, which works great. In addition to that I have a filter that I would like to set per view/iframe. So basically I would have the same dashboard rendered for the same user but with two different filters on the same page. I have tried using user attributes for this but that doesn’t work because the user attributes are per user and not per session, which kind of makes sense. There is no session or request level attributes that I can include in the embed URL unfortunately. But I think that is what I need. So right now I have to maintain 2 dashboards to solve this. Identical dashboards, only difference is the filter value.

Userlevel 2

Hi @Chris_Braun,


I’m not sure if this is exactly what you’re looking for, but if you want to pass different filters to one dashboard, you can do so by editing the filters within the URL itself.


For example, let’s say you have a dashboard with two filters, color and shape. The URL for the dashboard with the filters color is blue and shape is square applied would be something like;

https://master.dev.looker.com/dashboards/851?Color=Blue&Shape=Square&filter_c.... etc


You can have that same dashboard and change the filters to color is red and shape is square by altering the URL to;

https://yourinstance.looker.com/dashboards/###?Color=Red&Shape=Round&filter_c.... etc


If this isn’t what you’re looking for, please feel free to visit help.looker.com with your specific use case, and we’d be happy to take a look at it with you!

Yes this worked for us! Thanks

This post seems  a bit stale but I came upon the same requirement.  It would be helpful if public Looks could be passed a filter option.  There wouldn’t happen to be a way to create Looks in a batch way would there?  Like via a script?

Reply