Managing LookML files and folders

LookML project files are organized into folders in the file browser section of the Looker IDE. This page provides instructions for creating and managing folders and files in a LookML project.

For information about the structure and purpose of each type of file in a LookML project, see the Types of files in a LookML project documentation page.

Before you begin: Important file and folder naming conventions

When you're creating files and folders, it's best to keep the following naming conventions in mind:

  • Case sensitivity: 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.
  • Spaces and special characters: Filenames cannot include spaces or any of the following characters: / ? * : | " < > %
  • File extensions: When creating LookML files with the Looker IDE, Looker will automatically add the .lkml extension to the end of the filename if you don't include the extension manually. For example, if you enter the file name flights_data_tests, Looker will name the file flights_data_tests.lkml.
  • Changing the displayed name of a LookML object: If you want to change the displayed name of a model or LookML object, consider using the label parameter or the alias parameter instead of renaming the file or object. The label and alias parameters change the displayed name while preserving the underlying URL used for emails or other systems. In general, you should take precautions to make model changes as noninvasive as possible. If you do need to rename a model or an object, use the Content Validator to update all references to the model or object.

Creating folders

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. Select the Create Folder option from the appropriate menu:
    • To create a new folder at the top level of your directory structure, use the Add file or folder menu, which you can access by selecting the + (plus) icon at the top of the File Browser panel.
    • To create a new subfolder under an existing folder, use the three-dot Folder Options menu for the existing folder.
  2. Enter a name for the new folder.
  3. Select Create.

The new folder is added to the navigation pane.

Creating files

You can automatically generate a model file and view files based on your database when you create a new project. For existing projects, you can create new files manually.

To create a new file in your LookML project:

  1. Select the appropriate menu:

    • To create a new file at the top level of your directory structure, use the Add file or folder menu, which you can access by selecting the + (plus) icon at the top of the File Browser panel.
    • To create a new file under an existing folder, use the three-dot Folder Options menu for the existing folder.
  2. Select the type of LookML file you want to create. Select the links in the following list for a more detailed description of each type of file. You can create the following types of files:

  3. In the Create File pop-up, enter a name for the new file. See the important notes for creating files and folders for limitations and guidelines for naming your files.

  4. Select Create. The new file will be displayed where you created it. If needed, you can easily move it to another folder.

Considerations for creating view files

Most LookML developers start with one or more view files that are created automatically when the LookML project is generated from a set of tables in a database. However, in addition to the methods described on this page for creating blank view files and for uploading files, there are many ways a Looker developer in Development Mode can add view files to a LookML project:

To use a new view, add it to your model file using the explore parameter, or use the join parameter to join it to an existing Explore in your model file.

Adding a new view from an existing database table

You can create a view file from an existing database table while in Development Mode.

  1. Within a project, select the Add file or folder menu by selecting the + (plus) at the top of the project file list in the Looker IDE, or you can select a folder's menu to create the file inside the folder.

  2. Select Create View From Table.

  3. Looker displays a list of tables associated with one of your connections. To change the connection, use the Connection drop-down in the upper left.

  4. Select any tables that you would like to create views from by checking the box to the left of the table name. You can collapse and expand databases or schemas in this list to access all available tables.

  5. Scroll to the bottom of the page and select Create Views.

  6. Looker generates views containing LookML for all the table columns.

Uploading files

You can also upload files to your project from your computer. This is helpful if you have created JSON data files or LookML files locally on your computer.

To upload a file to your project, use the drag-and-drop function in the Looker IDE:

  1. Navigate to your project files.
  2. Drag the file from your computer into the Looker IDE. The file will be displayed at the root of your directory structure.
  3. Once the file is uploaded, move the item to another folder.

Deleting files and folders

Delete a folder or a file by selecting Delete from the item's three-dot File Options menu in the left panel of the IDE.

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.

Deleting files and folders in bulk

To delete folders and files in bulk:

  1. Select the Bulk Edit icon at the top of the File Browser panel.

  2. Select the items to delete. The number of files selected is displayed next to the Select Files header.

    • To select or deselect individual files, expand their folders and select the checkbox next to the filenames.
    • To select or deselect entire folders and their contents, select the checkbox next to the folder name.
    • To select an entire section of the directory list, use Shift-click. Select the checkbox for the top item in the range, and then hold down the Shift key and select 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. Select 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 selecting Yes, Delete, or return to item selection by selecting Cancel.

  5. Select the X in the Select Files header to exit bulk edit mode.

Moving items in a foldered project

To move files, 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 you hover over it.

Moving files and folders in bulk

To move folders and files in bulk:

  1. Select the Bulk Edit icon at the top of the File Browser panel.

  2. Select the items to move. The number of files selected is displayed next to the Select Files header.

    • To select or deselect individual files, expand their folders and select the checkbox next to the filenames.
    • To select or deselect entire folders and their contents, select the checkbox next to the folder name.
    • To select an entire section of the directory list, use Shift-click. Select the checkbox for the top item in the range, and then hold down the Shift key and select 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. Select the Move Items folder icon to select option. The IDE will then display a folder selection pop-up menu.

  4. In the Move to pop-up menu, choose a folder for the selected items, or select 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, select Move without a folder selected.

  5. Confirm the selected destination by selecting Move, create a new folder within the selected folder by selecting New Folder, or return to the main folder options menu by selecting the project name link in the file path.

  6. Select the X in the Select Files header to exit bulk edit mode.