Changing Looker Filters Via APIs

Harjeet Singh
3 min readAug 13, 2022

Looker is a well-known BI tool. I was recently involved in some work where I had to modify the looks/tiles of a Dashboard via looker API, and three weren’t many examples of how to do that in an easy way available anywhere.

So A looker Dashboard looks something like this.

<Image source — google>

Now all the GUI you see with pie charts and heat maps or lines are a different logical unit governed by some fixed query refreshing data in the background and then the looker presents that data to us on the UI. This logical unit is also called a Look or a Tile. These looks/tiles can be modified by UI as well, but if there is a change that needs to be propagated across hundreds of dashboards, it becomes a tricky problem. Enter Looker APIs.

If you explore a little bit here, you’ll realize this is where the solution comes out. But how? It depends on various things such as what filters? If we are talking about dashboard-level filters like the created date is last 7 days as shown in the above pic, that is fairly easy to do via UI but let's say we need to change filters of all looks/tiles of many dashboards, it can become tricky. It can go something like this.
First, we need authentication to Looker:

import looker_sdk
from looker_sdk.sdk.api31.models import *
sdk = looker_sdk.init31()
my_user = sdk.me() // should print your…

--

--

Harjeet Singh
Harjeet Singh

Written by Harjeet Singh

Problem Solver, writes on Tech, finance and Product. Watch out for my new creation, "THE PM SERIES"

No responses yet