User Guide Getting Started Help Center Documentation Community Training
Looker
Content Validation

The Content Validator is a Labs feature that must be enabled.

After making a change to your LookML model, you can use the Content Validator to check that your changes did not impact any of your users’ saved Looks or query-based dashboard tiles. 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 Looks or tiles that use the customer field, and will also provide an easy way to fix the error.

When finding and fixing field names, the Content Validator also checks for field names referenced in visualization configurations. One example of this is the Customizations area of the Series tab for column charts. In the Customizations area, you can specify the colors to use for the values in the data. To make this work, the visualization is referencing the field names from the data:

For this and other visualization configurations that reference field names, the Content Validator finds and fixes errors to keep your visualizations settings intact.

In addition, Content Validator finds and fixes fields that are hidden from visualizations:

The Content Validator includes fields hidden from visualizations so that your hidden fields stay hidden.

Starting Content Validation

To check and fix Looks and dashboard tiles, click Content Validator in the Develop menu:

Viewing the Content Validation Results

Content validation runs automatically when you start the Content Validator.

The content validation results show Looks and tiles that use model names, Explore names, view names, or field names that do not exist or can’t be found. This is often due to a typo or a missing join.

If you are in production mode, validation results are based on the production mode LookML. If you are in development mode, the results are based on your development mode LookML.

This is how the Content Validator is used:

  1. Click the Validate Again button in the upper left if you need to run validation again.
  2. If you want to make a change for all Looks and tiles on your instance, regardless of error, you can click the Find & Replace All Looks and Tiles button.
  3. Click the Group by tabs to change how errors are grouped:
    • Error: List each error, grouping together the Looks and tiles that have the error. This is useful if you want to fix the same error in multiple Looks and tiles at once.
    • Space: List each Space, grouping together its errored Looks and tiles. This is useful if you want to fix only the errors in a particular Space.
    • Look/Tile: List each Look and tile that has errors, grouping together its errors. This is useful if you want to fix all of the errors in a single Look or tile.
  4. 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 pre-mature, so users will experience broken Looks or tiles. Looker provides a warning message to help you remember this.
  5. 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.
  6. 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.

Fixing Errors

The basic purpose of content validation is to fix Looks and tiles (in bulk) when you make a breaking change in your LookML. You may also want to use content validation even when you haven’t introduced a breaking change. For example, you might decide that you prefer one field over another and want to make that replacement in all Looks and tiles, even though there is no error.

You can rename model, Explore, view, and field names in Looks and tiles, including any view and field names used in custom filters or table calculations. You also can remove any fields that are included in the Data section of a Look.

In any custom filters or table calculations, you will not be able to remove fields because typically you would need to make additional changes to keep the expression working. Instead, use the content validation error messages to find Looks or tiles where the custom filters and table calculation expression needs to be fixed, then rework the expression as appropriate.

You must be extremely careful when making changes using content validation. It does not have an un-do 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.

When to Fix Validation Errors

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 development mode work, 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.

Adjusting All Looks and Tiles

To adjust all Looks and tiles, regardless of whether or not they have an error, click the Find & Replace All Looks and Tiles button in the upper left.

Looker will display the following dialog:

To adjust all Looks and tiles:

  1. Select the type of LookML element you want to change (field, view, Explore, or model).
  2. Enter the name of the item you want to replace.
  3. Enter a new name for the field, view, Explore, or model.
  4. Click the purple button to make the change.

Adjusting Error Looks and Tiles Only

To adjust only Looks and tiles with errors, you can use the buttons in each line of the error table:

Looker provides the Replace button for each error. For errors with field names in the Data section of a Look or tile, Looker also displays the Remove button.

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

For example, below are two displays of the same error table, one grouped by Error, and one grouped by Look/Tile. You can see that the Group by setting changes the scope of the buttons:

In addition, if you group by Look/Tile, you have the additional option to delete Looks.

Replacing Names for Fields, Views, Explores, and Models

The content validation results show Looks and tiles that use model names, Explore names, view names, or field names that do not exist or can’t be found. You can use the Content Validator to replace those names with new or updated names.

  1. 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).
  2. In the error table, click the Replace button next to the error you want to correct.
  3. 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.
  4. Verify the name of the item you want to replace. The Content Validator fills this in automatically.
  5. Enter the new name of the item.
  6. If you have grouped by Error and there are multiple items (Looks, tiles, or both), you can click Show Looks and Tiles to see a list of items that the Content Validator will update.
  7. Optionally, you can uncheck any Looks or tiles to leave their names unchanged.
  8. Click the purple 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 these fields:

  1. 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).
  2. In the error table, click the Remove button next to the field error you want to correct.
  3. Verify the name of the item you want to remove. The Content Validator fills this in automatically.
  4. If you have grouped by Error and there are multiple items (Looks, tiles, or both), you can click Show Looks and Tiles to see a list of items that the Content Validator will update.
  5. Optionally, you can uncheck any Looks or tiles to leave their names unchanged.
  6. Click Remove Field to make the change.

Deleting Looks

If you group the error table by Look/Tile, you have the option to delete Looks in the table:

To use the Content Validator to delete Looks:

  1. Group the table by Look/Tile.
  2. In the error table, click the Select box next to the Looks you want to delete.
  3. Click Delete all selected Looks.
  4. 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.

Things to Consider

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

Content validation blocks some actions to help you avoid making mistakes:

Top