Question

Declaring views and explores in the Manifest file.

  • 23 August 2021
  • 1 reply
  • 70 views

I sit possible to declare the views and explores in Manifest file?

So, if someone else want to use my looker model but have different view/explore names but same dimensions and measures then they can just update the new names in Manifest file instead of explores and views and other places.

For example: I have three views page views, sessions and users and I have three explores: pageviews joining sessions and users, sessions joining sessions and users and users just by itself.

so How should I build the manifest file in a way where I just have to update the names in the one place and Looker will take care of the rest?


This topic has been closed for comments

1 reply

Hello!

If it’s primarily the name (by which I am hoping you are referring to what we can change with Label) there’s a way to rename an explore based on a constant that is defined in the manifest.

Here I’ve defined a test constant:

And here I’m using a view called “test” to make two explores, the default explore I’m labeling with a parameter, the second explore is extended from the first and uses the constant value for the label:
 

Extending it allows both explores to be present at the same time, but if this is being used as a template for a separate project/instance you could just use the constant-based label on the primary explore.

If you’re talking about the actual names of the view files, you can still leverage your existing definitions by extending the view you created into a new view.  But you cannot insert constant values into the explore definition in-lieu of an actual view name that I’ve been able to determine.

Another approach could be utilizing a tool like pylookml that will let you generate LookML based off a template.

I hope this is helpful.