Skip to main content

Set Looker User Attributes

You can use Spectacles to control user attributes on a run-by-run basis. You can specify user attributes for runs triggered manually in the UI or for runs triggered via the Spectacles API. User attributes are also used for our dbt Cloud integration.

Setting user attributes

Before you can control user attributes in a Spectacles run, you need to set the default values for any user attributes you would like to use. Spectacles needs to know what value it should be reset to so that other runs aren't affected.

  1. In the top-right of the Spectacles app, click Settings ⚙️.
  2. Scroll down to the Looker Settings section.
  3. Under User attribute, input the name of the user attribute that you would like to be configurable in Spectacles.
  4. Under Default value, input the default value for the user attribute. If you're not sure, use the default value set in Looker.
  5. Click Update Settings.

Setting user attributes on a manual run

  1. In the top menu, click Suites.
  2. Click Create Run.
  3. Override any default user attribute values you want for this run.
  4. Click Start.

Setting user attributes on a API-triggered run

When creating a run via the Spectacles API, pass the user_attributes key in the request body.

The value should be a dictionary of key-value pairs where the key is the name of the user attribute you would like to update and the value is the value it should be updated to:

"dbt_schema": "dbt_dylan",
"dbt_database": "staging"