The Error
A Look or dashboard throws the following error:
Could not find the model or view requested.
The Cause
Each Look or dashboard query is based on a model and an Explore. If the name of the model or Explore is changed in LookML, then the Look or dashboard query will no longer be able to find it.
For example, if the name of an Explore is changed from old-name
to new-name
, any associated Looks or dashboard queries will still try to use the old-name
Explore.
The Solution
1. Use a Label Instead
To just change the name of the Explore in the Explore menu, we can use the label
parameter. This avoids the error altogether by preserving the old name in the LookML, while showing users the new name.
explore: old { label: "new" ... }
2. Use the Content Validator
The Content Validator has a find and replace functionality. We can use that to replace the Explore name across all Looks. This will change every Look and dashboard query that uses old-name
, so take this step with caution.
3. Change the URL
The expanded URL of a query contains the model name, Explore name, and field names. We can take advantage of this functionality to change the Explore name of our Look or dashboard query.
- From the Look or dashboard query, select Explore From Here.
- Click the gear in the top right next to Run and Edit, then select Share.
- Copy the Expanded URL and paste it somewhere else like your browser. (Do not press Enter yet. Otherwise, it will turn into a shortened URL.)
- Modify the URL text to change the name of the Explore. The URL takes the form:
https://instance_name.looker.com/explore/MODEL_NAME/EXPLORE_NAME?fields=...
- Press Enter or Return to navigate to the URL, then save the Explore as a Look or dashboard query.