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
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. If your Looker developers have not organized your project files into folders, your project will have a flat file structure, with files listed alphabetically in the file browser panel.

If you want to organize your project into folders, see the Organizing an Existing Project with IDE Folders section on this page for recommendations.

Here is an example project where a developer has added folders for different types of project files, such as explores, models, and views:

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

You can also click the Search Files icon to search for a project file or click the Collapse all folders icon to minimize your project navigation tree to display only the top-level folders:

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.

Organizing an Existing Project with IDE Folders

In Looker 7.12, the IDE Folders Toggle is removed and all LookML projects are enabled for IDE folders automatically. If your project previously had the legacy, flat file structure, that flat file structure will still exist in your project. You can choose to keep this flat file structure, but if you choose to organize your project files into folders, it is highly recommended that you make the following preparations:

Be aware that when you move a file in Git, you are effectively deleting the file and creating a new file with a new file path. This means that the Git history for the file will be empty, because Git considers it a new file. To see the file’s Git history before it was moved, use your Git interface to navigate to the file in its original location and view the Git history from there.

Once all your developers have pushed the uncommitted changes and paused all work on the project, you can then migrate the project to its new directory structure.

Assign a single developer to do all the following steps:

  1. Verify that all updates on all development branches have been deployed to production. This includes the development branches of the developer performing the migration to IDE folders.
  2. Verify that all other developers have stopped making changes to the project.
  3. Pull from production.
  4. Create the project’s folders.
  5. Move the project files into the folders, either one file at a time or using bulk edit.
  6. Validate the project’s LookML. It is expected that you will have multiple LookML errors and warnings, since the include and map_layer statements use references to file locations that likely will have been moved during this procedure.
  7. Update any include and map_layer statements in your project to match the file’s new path. In addition, you may see LookML validation errors for referenced objects that can no longer be found because their file paths have changed. See the Using include with IDE Folders section of this page for information on using include with IDE folders, and the Using map_layer with IDE Folders section of this page 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 your project folders. This will prevent 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.

  8. Commit the changes.

  9. Deploy the updates to production.
  10. Inform the other Looker developers that they can now pull the updates from production and resume developing in the project.

Imported Projects Folder

If you import a project, the Looker IDE automatically creates an imported_projects folder. Files from both local projects and remote projects are listed in the imported_projects folder. You can click on an imported project file to view its contents:

All imported project files are shown in light gray to indicate that they are read only. Since they cannot be edited, imported projects files are not visible when you are bulk-editing files in the IDE.

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.

When creating folders, keep in mind that LookML is case sensitive. Be sure to adhere to your project’s conventions when naming your folders. For example, if your convention is to use all lowercase letters in your project, you would want to name your folder views instead of Views. This makes a difference especially when you need to specify a file’s path, such as when including files. Generally, it’s a good idea to consistently use lowercase letters when you name LookML objects and folders.

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.

Creating Items Within a Folder

To create a new file inside a folder, click on the folder’s menu and select the type of file you want to create:

You can use this menu to create the following types of files:

Moving Items in a Foldered Project

You can drag and drop a single file or an entire folder with all its contents into new locations:

Drag and drop a file or a folder into another folder. The destination folder does not need to be expanded to receive other folders or files. A folder automatically expands when items are hovered over it.

When you change a file’s path, be sure to update any include statements in your project to match the new file path. See the Using include with IDE Folders section of this page for information on using include with IDE folders.

Also, be aware that when you change a file’s path, Git effectively deletes the file and creates a new file with the new file path. This means that the Git history for the file will be empty, because Git considers it a new file. To see the file’s Git history before it was moved, use your Git interface to navigate to the file in its original location and view the Git history from there. (The same logic applies for a renamed file, since Git effectively deletes the file and creates a new file with a different name.)

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 the Using include with IDE Folders section of this page 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 you delete a folder, the IDE shows a confirmation pop-up. The pop-up specifies how many items are included in the deletion, which includes the folder and any files inside the folder.

Bulk Editing Files and Folders

You can also select multiple folders and files to move into new locations, or to delete.

Moving Files and Folders in Bulk

To move folders and files in bulk:

  1. Click the Bulk Edit icon at the top of the file browser.
  2. Select the items to move. The number of files selected is displayed in purple next to the Select Files header.
    • To select or deselect individual files, expand their folders and click the checkbox next to the filenames.
    • To select or deselect entire folders and their contents, click the checkbox next to the folder name.
    • To select an entire section of the directory list, you can use Shift-click. Click the checkbox for the top item in the range, then hold down the Shift key and click the checkbox for the last item in the list. Both items and all items in between will be selected. You can also just Shift-click on an item to select the item and everything above it in the directory list.
  3. Click the Bulk Move Items folder icon to select option. The IDE will then display a folder selection pop-up menu.
  4. In the pop-up menu, choose a folder for the selected items, or click New Folder to create a new folder. The project name will display the file path of the folder you have selected at the top of the next menu page. To move items to the root directory of your project, click Move without a folder selected.
  5. Confirm the selected destination by clicking Move, create a new folder within the selected folder by clicking New Folder, or return to the main folder options menu by clicking the project name link in the file path.
  6. Click the X in the Select Files header to exit bulk edit mode.

After you change a file’s path, be sure to update any include statements in your project to match the new file path. See the Using include with IDE Folders section of this page for information on using include with IDE folders.

Also, be aware that when you change a file’s path, Git effectively deletes the file and creates a new file with the new file path. This means that the Git history for the file will be empty, because Git considers it a new file. To see the file’s Git history before it was moved, use your Git interface to navigate to the file in its original location and view the Git history from there. (The same logic applies for a renamed file, since Git effectively deletes the file and creates a new file with a different name.)

Deleting Files and Folders in Bulk

To delete folders and files in bulk:

Deleting a folder will delete all its contents. Before deleting a folder, verify that you want to delete the files in the folder. If you want to keep them, move the files to a different location before deleting the folder.

  1. Click the Bulk Edit icon at the top of the file browser.
  2. Select the items to delete. The number of files selected is displayed in purple next to the Select Files header.
    • To select or deselect individual files, expand their folders and click the checkbox next to the filenames.
    • To select or deselect entire folders and their contents, click the checkbox next to the folder name.
    • To select an entire section of the directory list, you can use Shift-click. Click the checkbox for the top item in the range, then hold down the Shift key and click the checkbox for the last item in the list. Both items and all items in between will be selected. You can also just Shift-click on an item to select the item and everything above it in the directory list.
  3. Click the Delete Items trash icon. The IDE will then display a pop-up menu listing the items selected.
  4. Confirm the items to be deleted by clicking Yes, Delete, or return to item selection by clicking Cancel.
  5. Click the X in the Select Files header to exit bulk edit mode.

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.

When using include, keep in mind that LookML is case sensitive. When specifying a file’s path, you must match the case of the file and of the folders in the path. For example, if your file is in the Views folder, you must match this capitalization in the include parameter. So you would specify include: "/Views/accidents.view". Generally, it’s a good idea to stick with lowercase when naming LookML objects and folders.

You can use absolute or relative paths in the include statement (see the Path Syntax section of this page for examples), and you can use the wildcards * and ** to include multiple files at once (see the Wildcard Examples section of this page for examples).

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

The following statements will include the products view, the order_facts view, and all views in the /views/users/ directory:

include: "/views/products.view" include: "/views/orders/order_facts.view" include: "/views/users/*.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 because their file paths have changed.

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

If you are using LookML refinements, do not use wildcards in your includes. LookML refinements leverage the order of includes, and using wildcards in your includes does not allow you to control the order in which each file is included. See the LookML Refinements documentation page for more information about refinements.

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 (match only a single level of nesting). Matches all myfile.lkml files in any direct child directories of PATH.
PATH/**/my_file.view Recursive wildcard matching (match any amount of nesting) for 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