Hi guys! Is there a way, to create or edit filters? My goal is to create many similar reports (~200) with only one chart. Then we will embed these reports personally to the relevant pages. But the problem is that I need a unique filter for every chart/report.
Is there a solution how to avoid the manual creation of every filter?
Luka, excuse me, but one more question. I’ve tried the link, but there are more links to API documentation and screenshots which don’t work Is it a temporary problem?
Hi there! You can use the Looker API to do this programmatically update filters on dashboards. You can follow these steps:
Use GET/dashboards/{dashboard_id}to get the metadata for the dashboard you want to recreate.
You can take a look at info returned in the filter dashboard_filters section. These are all the filters you have on the original dashboard, this is the part that you’ll want to edit and use in step 4.
Make a copy of your original dashboard with POST`/dashboards/{dashboard_id}/copy```
Use the Update Dashboard Filter endpoint PATCH/dashboard_filters/{dashboard_filter_id} to make updates to the original filters on the new dashboard. If you’re changing the filter field completely, you may also need to use the to update the filter listeners on each dashboard tile using the Update DashboardElement endpoint PATCH/dashboard_elements/{dashboard_element_id}in the result_maker.filterables section.
If the filter field is consistent across some or all of these reports that you are embedding, you can reuse the same dashboard but pass a different filter value via the embed url. You might be able to accomplish what you’re looking to do via Looker’s signed Embedding functionality without creating many copies of the same dashboard. For example, if you want to show different values for 2 embed users for a report filtering on State, you can use this URL for User A: mycompany.cloud.looker.com/embed/dashboards/1?State=California and this URL for User B: mycompany.cloud.looker.com/embed/dashboards/1?State=Texas. You’ll want to use user attributes for these embed users to ensure that row level data access is restricted to the appropriate level.