We have the looker Explore view Embedded into our application to allow Ad-Hoc analysis of data. Now we would like to expand that functionality so that users can save the explore they create as a look and view it in our product.
The issue is that we can’t use the save Dialog enabled by the “save_content” sso.permission because there is additional information about the look that the user needs to provide before we can display the look as a report in our products UI. So this creates the case where a user could create a look using the explore save and never join it to the rest of the information required to display the report creating a lot of orphaned reports.
The idea we had to solve this is to use the create_look API function to create a new report using the data from the embedded explore view.
This leads to my question, is there a way to access the JSON representing the look created by a Embedded Explore without saving it using the Looker save UI so it can be passed to the API?
Thanks in Advanced
If this is in place, then the general plan for creating a look based on an explore would be:
If the explore URL does not include a “
qid=”, and just has model/view info, then that’s what will be needed to construct a query.
If the explore URL involves complex filters, things could get messy because the filters expression syntax in the explore URL may not match the expression syntax for filters in the query filter property of a Look. You would need to do some sort of conversion.
Also note that ideally, the api proxy server would be set up to auth into the Looker API using information provided by the web app as we want to avoid passing Looker user credentials (or access_tokens) back to the browser app for security reasons.
I hope that helps! Feel free to visit help.looker.com if you’re running into specific issues.
That sounds really interesting, and something that we might like to do too.
How did you go with that approach? Did you get it to work?
Now I said there is a caveat… If you create a Look using the above process the filters will not save and there is no way to add them using the current API.
If the create_dashboard API was working you could create a dashboard with the filters attach your look to it then embed the dashboard using the regular SSO embed process but this API is currently disabled in the most recent version of looker and since at least 4.x.
What we ended up doing was directly inserting into the looker database directly to create a dashboard manually and link the filters and look to it. It works perfectly I don’t recommend doing it unless you really have to because its super risky and hopefully the looker team will enabled the create_dashboard endpoint so you don’t have to do it at all.