User Guide Getting Started Help Center Documentation Community Training
Looker
  
English
Français
Deutsch
日本語
Content Validation

The Content Validator searches your LookML for model, Explore, and field names referenced in your Looker content. It’s a super useful tool for validating your LookML references, for fixing errors in your LookML after making changes, and for updating the names of your LookML elements across your project.

You must have the develop permission to use the Content Validator.

To open the Content Validator, select Content Validator from the Develop menu:

From here, you can use the Content Validator in two ways:

Before Using the Content Validator

You must be extremely careful when making changes using content validation. It does not have an undo function, and it has the potential to impact many Looks, dashboards, and their Explore from Here links. If you do make a mistake, then attempt to correct it as soon as possible, before additional changes make it harder to isolate the affected Looks.

Also, consider your timing when using the Content Validator. When you push development changes to production you should fix affected Looks and tiles at approximately the same time, so that they are broken for the minimum amount of time. If you fix Looks and tiles too early, based on your work in Development Mode, they will appear broken to users until you push your changes. Similarly, if you delay in fixing Looks and tiles until long after pushing the change, they will appear broken to users until you fix them.

If you use the Content Validator to change field names that serve as filters in your Looks or dashboards, be sure to review the Filters section of your scheduled Looks and dashboards and update the filters as needed to reflect your changes. If a scheduled content delivery includes filters that no longer function (for example, if the referenced field has changed), the scheduled delivery could expose unfiltered data.

Using the Content Validator to Fix Errors

The Content Validator is a useful tool for finding and fixing errors resulting from changes in your LookML. For example, if you change a field name from customer to user, any Looks or dashboard tiles that included the customer field will no longer function (unless you used the alias parameter). The Content Validator will list any references to the customer field, and will also provide an easy way to fix the error.

The Content Validator shows errors for the following:

The Content Validator does not show errors for the following:

Running the Content Validator

Read the section Before Using the Content Validator before proceeding. The Content Validator can impact many parts of your Looker content, so it’s important to plan and consider beforehand.

To validate your LookML with the Content Validator:

  1. Click the Validate button.
  2. Click the Group by tabs to change how errors are grouped:
    • Error: List each error, grouping together the Looker content that has the error. This is useful if you want to fix the same error in multiple pieces of content at once.
    • Space: List each Space, grouping together the Looker content that has errors. This is useful if you want to fix only the errors in a particular Space.
    • Content: List each piece of content that has errors, grouping together its errors. This is useful if you want to fix all of the errors in a single Look, tile, filter, etc.
  3. If you are in Development Mode, it’s important to understand the implications of changing Looks and tiles. If you “fix” them before making your breaking changes live, there will be a period of time when the fix is premature, so users will experience broken Looks or tiles. Looker provides a warning message to help you remember this.
  4. The error table displays any error, along with a list of Looks and tiles that contain the error, plus the underlying model and Explore that are producing the error. You can use the Group by tabs at the upper right of the page to change the layout of the error table.
  5. Looker provides the Replace and/or Remove buttons for each row, depending on the error type. These buttons provide functionality to fix the errors and are described in more detail below.

Viewing the Content Validation Results

The content validation results show Looker content that uses model names, Explore names, view names, or field names that do not exist or can’t be found. See this section above for details about the LookML elements that the Content Validator can find and validate.

Validation results are based on the LookML available in the mode you’re in when you run the validator. If you are in Production Mode, the validation results will reflect all LookML that has been pushed to production. If you are in Development Mode, the validation results will reflect your saved LookML, even if it hasn’t been pushed to production.

Errors may be due to intentional changes in your LookML, or due to a typo or a missing join.

To adjust errors, you can use the buttons in each line of the error table:

Looker provides the Replace button for each error (see this section below for how to replace names with the Content Validator). For errors with field names in the Data section of a Look or tile, Looker also displays the Remove button (see this section below for how to remove names with the Content Validator).

Depending on your Group by setting, the buttons will apply to a single item (Look or tile), or to multiple items:

Here’s an example where the table is grouped by Error, so the buttons affect all of the instances of that error:

Here’s an example where the table is grouped by Content, so the buttons affect just the one instance of the error on a single piece of content:

In addition, if you group by Content, you have the additional option to delete Looks.

Replacing Names for Fields, Views, Explores, and Models

The content validation results include a Replace button for the following types of elements so that you can rename them:

For any of these errors, you can use the Content Validator to replace an attribute of the content that is equal to or more general than the attribute that is erroring:

Here’s how to use the Content Validator to replace the names of elements in your model:

  1. Click Validate to run the Content Validator.
  2. Click a Group by setting to choose how errors are grouped. In this example, we’re grouping by Error so we can simultaneously adjust multiple items at once.
  3. In the error table, click the Replace button next to the error you want to correct.
  4. In the dialog, select the type of LookML element you want to change: field, view, Explore, or model. Looker displays the appropriate options for each error.
  5. Verify the name of the item you want to replace. The Content Validator fills this in automatically.
  6. Enter the new name of the item.
  7. If you have grouped by Error and there are multiple items that will be affected, you can click Show Content to see a list of items that the Content Validator will update.
  8. Optionally, you can uncheck any listed items to leave their names unchanged.
  9. Click the button to make the change.

Removing a Field Name

For errors with field names in the Data section of a Look or tile, the error table will provide a Remove button to the right of the error. You can use the Content Validator to remove fields that are:

You cannot use the Content Validator to remove fields from custom filters, custom fields, nor table calculations, because typically you need to make additional changes to keep the expression working. Instead, use the content validation error messages to find places where custom filters, custom fields, and table calculation expressions need to be fixed, then rework the expression as appropriate.

  1. Click Validate to run the Content Validator.
  2. Click a Group by setting to choose how errors are grouped. In this example, we’re grouping by Error so we can simultaneously adjust multiple items (Looks, tiles, or both).
  3. In the error table, click the Remove button next to the field error you want to correct.
  4. Verify the name of the item you want to remove. The Content Validator fills this in automatically.
  5. If you have grouped by Error and there are multiple items (Looks, tiles, or both), you can click Show Content to see a list of items that the Content Validator will update.
  6. Optionally, you can uncheck any Looks or tiles to leave their names unchanged.
  7. Click Remove Field to make the change.

Deleting Looks

If you group the error table by Content, you have the option to delete Looks in the table.

To use the Content Validator to delete Looks:

  1. Click Validate to run the Content Validator.
  2. Group the table by Content.
  3. In the error table, click the Select box next to the Looks you want to delete.
  4. Click Delete all selected Looks.
  5. Click OK in the confirmation box to delete the selected Looks.

If you accidentally delete a Look, your Looker admin might be able to recover it for you. Looker stores deleted content in the trash until your Looker admin team empties the trash as part of their maintenance process.

Using the Content Validator to Find and Replace

The Content Validator can also be used to search and replace the names for models, Explores, and fields. For example, you might decide that you prefer one field over another and want to make that replacement in your project, even though there is no error. The complete list of elements that the Content Validator can search/replace is provided in this section above.

Read the section Before Using the Content Validator before proceeding. The Content Validator can impact many parts of your Looker content, so it’s important to plan and consider beforehand.

To use the Content Validator as a find and replace tool:

  1. Click the Find & Replace in All Content button.
  2. Select the Type of LookML element you want to change (field, view, Explore, or model).
  3. Enter the Name of the item you want to replace.
  4. Enter a Replacement Name for the field, view, Explore, or model.
  5. Click the Replace button to make the change.

Things to Consider

Plan to rerun content validation to view the results of any fixes you make.

Note the following about the Content Validator:

Top