User Guide Getting Started Help Center Documentation Community Training
New LookML
Old LookML
New LookML
Looker
  
English
Français
Deutsch
日本語
Working with Folders in the IDE

The Looker IDE supports folders for your project files. Folders are shown in the left navigation pane of the IDE.

Here is an example project where the folders Models and Views have been added by a developer:

You can create new folders or move items to a folder, as described below.

You can also click the Jump to file icon to search for a project file or click the Collapse all folders icon to miminize your project navigation tree to the top level:

As you organize your LookML files with folders, you need to commit your changes and deploy them to production before other Looker developers can see them. This is just like any change you make to your LookML project.

How to Enable or Disable IDE Folders

When you upgrade to Looker 6.16, all of your existing LookML projects will have IDE folders disabled so that your projects will be the same as before. IDE folders will be automatically enabled for any new LookML projects created in Looker 6.16 or later.

The option to enable and disable IDE folders will be available for several releases, and then all projects will be enabled for IDE folders.

If you are a Looker admin, you can save changes to the Project Settings page and enable or disable IDE folders. To enable or disable folders for a project:

  1. In the project, select Project Settings from the Git drop-down menu.
  2. In the Project Settings page, select or deselect the Enable Folders check box.
  3. Click Save Project Settings.

Migrating an Existing Project to IDE Folders

When you upgrade to Looker 6.16, existing LookML projects will have IDE folders disabled so that your projects will be the same as before. You can enable folders for a project from the Project Settings page.

Before enabling folders for a project, note the following:

Once you enable folders for the project, none of your file paths or files are affected until you create folders and move items into folders.

When you change a file’s path, be sure to update any include and map_layer statements in your project to match the file’s new path. You may see LookML validation warnings on your old include statements if they no longer refer to existing files or file paths. In addition, you may see LookML validation errors for referenced objects that can no longer be found due to their files not being included. See this section for information on using include with IDE folders, and this section for information on using map layers with IDE folders.

Handy Tip: You can use wildcards to create a temporary fix for LookML validation warnings and errors resulting from include statements. Using view files as an example, you can specify include: "/**/*.view" to include all files in all of your project folders. This will prevent the LookML validation problems while you continue developing. However, this is not a recommended solution for the long term, since including more files than are needed can affect performance.

Disabling Folders for a Project

If you have organized a project’s files into folders, you can still disable folders without breaking anything:

The option to disable IDE folders will be available for several releases, and then all projects will be enabled for IDE folders.

With folders disabled, you can remove a file from its folder by using Rename to remove folders in the path name:

When you change a file’s path, be sure to update any include and map_layer statements in your project to match the file’s new path. You may see LookML validation warnings on your old include statements if they no longer refer to existing files or file paths. In addition, you may see LookML validation errors for referenced objects that can no longer be found due to their files not being included. See this section for information on using include with IDE folders, and this section for information on using map layers with IDE folders.

Creating a New Folder in the IDE

You can create folders for different file types (such as view files or model files). You can even create subfolders, which is very useful if you want to include a subset of your views.

To create a folder:

  1. Click + at the top of the project file list in the Looker IDE, then select Create Folder.
  2. Enter a name for the new folder.
  3. Click Create.

The new folder is added to the navigation pane.

Moving Items in a Foldered Project

You can drag and drop a file or an entire folder (including its contents) into new locations:

  1. Click the arrow to the left of the folder to expand the folder’s contents. (You need to expand the folder, even if the folder is empty.)
  2. Drag and drop a file or another folder into the folder.

Deleting a Folder

Deleting a folder also deletes its contents, which will affect any include statements that refer to the files in the folder. See this section for information on using include with IDE folders.

Before deleting a folder, verify that you want to delete the files in the folder, or move the files to a different location before deleting the folder.

You can delete a folder by selecting Delete from the folder’s menu:

When deleting a folder, the IDE shows a confirmation pop-up. The pop-up specifies how many items are included in the delete, which includes the folder and any files inside the folder:

Using include with IDE Folders

Once you have organized your project files into folders, you need to provide the file’s path when using the include statement. You can use absolute or relative paths in the include statement (see this section for examples), and you can use the wildcards * and ** to include multiple files at once (see this section for examples).

For example, if you have this directory structure in your project:

The following statements will include the accidents view, the carriers view, and all views in the /Views/aircraft/ directory:

include: "/Views/accidents.view" include: "/Views/airlines/carriers.view" include: "/Views/aircraft/*.view"

When you change a file’s path, be sure to update any include statements in your project to match the file’s new path. You may see LookML validation warnings on your old include statements if they no longer refer to existing files or file paths. In addition, you may see LookML validation errors for referenced objects that can no longer be found due to their files not being included.

Handy Tip: When using wildcards, you can check which files are included by hovering over the information icon in the change bar of the file, or by clicking on the include statement and looking in the Quick Help:

Path Syntax

Here are some example syntaxes you can use for including files:

Syntax Description
PATH Relative path starting from current file’s location.
./PATH Relative path starting from current file’s location. This example points to the same file as the above example: PATH.
../PATH Relative path starting from current file’s parent directory.
/PATH Absolute path starting from current project’s root.
//PROJECT_NAME/PATH Absolute path starting from the root of an imported project called PROJECT_NAME.

Wildcard Examples

Here are some examples using wildcards (note that you can replace PATH with the path syntaxes in the previous table):

Syntax Description
PATH/*.view Wildcard matching files ending with .view at PATH.
PATH/*.view.lkml Wildcard matching files ending with .view.lkml at PATH.

Because view files have the extension .view.lkml, this example specifies the same file as the previous example, PATH/*.view. The .lkml part is not displayed in the IDE, nor is the .lkml part required for include statements. However, you can use wildcards to leverage this common part of the file extension. See the LookML Project Files documentation page for a list of project file extensions.
PATH/*.lkml Wildcard matching files ending with .lkml at PATH.

Note that several file types share .lkml as the final part of the file extension, such as .view.lkml and .model.lkml. The .lkml part is not displayed in the IDE, nor is the .lkml part required for include statements. However, you can use wildcards to leverage this common part of the file extension. See the LookML Project Files documentation page for a list of project file extensions.
PATH/myfile.* Wildcard matching files called myfile with any extension type at PATH.
PATH/myfile.*.lkml Wildcard matching files called myfile with any .lkml extension type at PATH.
PATH/my*file.view Wildcard matching files starting with my and ending with file.view at PATH.
PATH/my*fi*le.view Wildcards matching files starting with my, followed by some characters, then fi, some additional characters, and ending with le.view at PATH.
PATH/*/myfile.lkml Folder name wildcard. Matches all myfile.lkml files in any direct child directories of PATH.
PATH/**/my_file.view Recursive wildcard matching all files called my_file.view.lkml at PATH and all subdirectories.
PATH/**/*.view Recursive wildcard matching all files ending with .view.lkml at PATH’s subdirectories.
PATH/**/my_folder/myfile.view Recursive wildcard matching the subpath /my_folder/myfile.view at any depth under PATH.

Using map_layer with IDE Folders

If you have IDE folders enabled for your project, you need to use the file path when you specify a project file for map_layer:

map_layer: neighborhoods { file: "/maps/my_neighborhoods.json" }

Top