home User Guide Getting Started Help Center Documentation Community Training Certification
menu
close
settings
Looker keyboard_arrow_down
language keyboard_arrow_down
English
Français
Deutsch
日本語
search
print
Customizing Looker Marketplace Blocks

The Looker Marketplace is a central location for finding, deploying, and managing many types of Looker content such as applications, visualizations, and plug-ins.

This page describes how to customize Looker Blocks™. Blocks are pre-built LookML models, including dashboards and Explores, for a variety of popular data sources. Blocks installed using the Looker Marketplace can be customized by LookML developers using the block’s config project.

To build on a data block, your Looker admin must enable the Local Project Import Labs feature.

Some blocks can be installed from the Looker Marketplace. If deploying your block through the Looker Marketplace, your Looker admin must enable the Marketplace and Local Project Import Labs features. See the Looker Marketplace documentation page for information on installing and managing Looker Blocks from the Looker Marketplace.

For more information about all available Looker Blocks, see the Looker Blocks documentation page.

Overview of Block Structure

Looker Marketplace Blocks consist of a core project and a config project:

To illustrate this, suppose you are customizing a block that contains an Orders Explore. The dashboards and Explores for a block that are visible in the Looker UI are based on the final layer of the following extension chain:

The Core Project

The core project is read-only and contains the block’s core analytical code. The core project may also contain:

The Config Project

You can customize a Marketplace Block by making changes to files in the block’s config project. The config project contains views, Explores, and dashboards that extend the LookML defined in the core project.

Customizing a Block

You can customize a block by editing the files in the block’s config project. For example, you can create or modify dimensions and measures, define new views and join them to Explores, and make changes to existing Explores and dashboards. The changes you make in the config project will be brought into the core project’s content layer and reflected in the block’s Explores and dashboards.

Accessing the LookML for a Block

In addition to the method described in this section, you can also use LookML refinements to build on the LookML of views and Explores in your projects.

You can access a block’s config project from the Develop menu, or from the Manage Projects page in the Develop menu. The name of a config project typically ends in _config, whereas the name of the core project typically does not have a suffix.

Although you cannot directly modify a block’s read-only core project, you may wish to use the LookML defined in the block’s read-only core project as a reference when customizing the block’s config project. To view the block’s core project:

  1. From the Develop menu, select Manage LookML Projects.

  2. On the LookML Projects page, beneath the Marketplace Projects heading, select the View LookML button to the right of the core project’s listing.

Defining and Redefining Fields

You can define new fields or redefine existing fields by modifying the views in the config project. For example, suppose you want to create a new measure that evaluates whether the total sale price for an order is greater than $1,000. In this example, there is a measure total_sale_price defined in the orders_core view in the core project:

measure: total_sale_price { type: sum value_format_name: usd sql: ${sale_price} ;; drill_fields: [detail*] }

In the orders_config view in the config project, you can define a measure of type: yesno called is_large_total. In this example, the sql parameter evaluates whether the total_sale_price value is greater than $1,000.

measure: is_large_total { description: "Is order total over $1000?" type: yesno sql: ${total_sale_price} > 1000 ;; }

As another example, suppose you wish to hide a dimension customer_email from the field picker. To do this, you can set customer_email to hidden: yes in the orders_config view:

view: orders_config { extends: [orders_core] extension: required dimension: customer_email { hidden: yes } }

Joining Views to Existing Explores

In a block’s config project, you can create new views and join them to the block’s existing Explores, or join existing views to the block’s Explores.

For example, suppose you have created a new view in the config project, customer_address, that you would like to join to the Orders Explore. You can join the new customer_address view to the orders_config Explore in the config project as follows:

explore: orders_config { join: customer_address { sql_on: ${customer_address.customer_id} = ${orders_config.customer_id} ;; type: left_outer relationship: many_to_one } }

Because the orders Explore in the core project extends the orders_config Explore, the new customer view will be joined to Orders, making it available to query in the UI.

Customizing Explores

In addition to joining new views to a block’s existing Explores, you can make further customizations, such as changing the label for the Explore, or specifying whether the Explore should be hidden.

For example, suppose you have a Customers Explore that you wish to hide from the Explore menu. In the block’s core project, there are two Explores defined, customers_core and customers. The Customers Explore in the Looker UI is based on the customers Explore, which extends customers_config:

explore: customers_core { extension: required } explore: customers { extends: [customers_config] }

Because the customers Explore extends the customers_config Explore, changing the customers_config Explore in the config project to hidden: yes also sets customers to hidden: yes and hides the Customers Explore from the Explore menu:

explore: customers_config { extends: [customers_core] extension: required hidden: yes }

Customizing Dashboards

You can create new dashboards or make changes to a block’s existing dashboards, such as by adding new tiles or changing a dashboard’s layout. You can customize an existing dashboard by making a user-defined dashboard (UDD) or LookML copy of the dashboard and editing the copy.

You can make a copy of the dashboard by first converting it to a user-defined dashboard. Or, you can navigate to the dashboard file in the core project and copy its contents, then create a new dashboard file.

To make changes to a dashboard using a UDD copy:

  1. Navigate to the dashboard.
  2. From the gear menu, select Copy from LookML into a folder.
  3. In the Copy Dashboard window, choose a folder and select Copy or Copy & View to create a UDD copy of the dashboard.
  4. Using the Looker UI, make the desired changes to the UDD copy of the dashboard.
  5. Once you have finished editing the dashboard, select Get Dashboard LookML from the dashboard’s gear menu. For dashboards (beta), select Get LookML and navigate to the Dashboard tab.
  6. In the Dashboard LookML window, select Copy to Clipboard to copy the dashboard LookML.
  7. Create a new dashboard file in the config project, and paste the copied LookML from your clipboard into the file.
  8. In the new dashboard file, use the extends parameter to extend the original dashboard.
  9. Save the new LookML dashboard file.

To make changes to a dashboard using a LookML copy:

  1. Navigate to the dashboard file in the core project and copy the LookML for the desired dashboard.
  2. In the config project, create a new dashboard file and paste the LookML that you copied from the core project.
  3. In the new dashboard file, use the extends parameter to extend the original dashboard.
  4. Make any desired changes to the dashboard LookML.

Because the config project’s LookML dashboard files are included in the core project, dashboards you add to the config project will be listed with the block’s other dashboards and Explores.

Overriding Extended LookML with sql_table_name

You can override LookML that is extended into the config project from the core project, such as the schema or table name provided in the sql_table_name parameter for a view.

In this example, the view issue_core is written as follows in the read-only core project for a block:

include: "//@{CONFIG_PROJECT_NAME}/github.view" view: issue { extends: [issue_config] } view: issue_core { sql_table_name: @{GITHUB_SCHEMA}.issue ;; … }

Let’s suppose that github_skeleton is the value provided for the GITHUB_SCHEMA constant, which is defined in the core project’s manifest file as follows:

constant: GITHUB_SCHEMA { value: "github_skeleton" export: override_required }

Before making any changes to the above LookML, we can see that the SQL for a query using an Explore based on the issue table is written as follows:

SELECT CASE WHEN issue.pull_request THEN 'Yes' ELSE 'No' END AS issue_pull_request, COUNT(*) AS issue_count FROM github_skeleton.issue AS issue GROUP BY 1 ORDER BY 2 DESC LIMIT 500

In the issue_config view in the config project, you can specify a different schema and table name for the view using the sql_table_name parameter. This will override the values defined in the core project.

view: issue_config { extension: required extends: [issue_core] sql_table_name: github_dev.issue_dev ;; }

In this example, the schema github_skeleton is replaced with the schema github_dev, and the table name issue is replaced with the value issue_dev. After saving this change, we can see that the SQL from the same Explore as above adjusts to our new values for sql_table_name:

SELECT CASE WHEN issue.pull_request THEN 'Yes' ELSE 'No' END AS issue_pull_request, COUNT(*) AS issue_count FROM github_dev.issue_dev AS issue GROUP BY 1 ORDER BY 2 DESC LIMIT 500

Troubleshooting a Block

If a Marketplace Block displays errors, it’s possible that your schema doesn’t match the structure of the block.

You may also wish to check that the constants provided during the block’s installation, representing the block’s connection, database, or schema, have been defined correctly. To do this, you can:

  1. Navigate to the Looker Marketplace by selecting the shop icon ( ) on the Looker menu bar.

  2. In the Looker Marketplace, select Manage to open the Manage page.

  3. On the Manage page, select the gear icon for the block to view its settings.

  4. In the Update configurations window, confirm that the block is configured correctly. If you need to change any configuration settings, select Update when you are done.

Top