Skip To Content

Add items to a notebook

The notebook editor includes a sidebar where you can browse, search, and add portal items such as layers and web tools to a notebook. Starting at 10.8, any portal item can be added to a notebook as a code snippet in a new cell. The item can be hosted in your organization or made publicly available in ArcGIS Online or ArcGIS Living Atlas of the World.

Browse and search for content

To browse and search for content in the notebook editor, complete the following steps:

  1. On the top ribbon of the notebook editor, click the Add button Add to open the content browser panel.

    Several tools that you can use to find content are listed.

  2. At the top of the panel, click the drop-down menu and select the location of displayed content.

    The options are as follows:

    • My content
    • My favorites
    • My groups
    • My organization
    • Living Atlas
    • ArcGIS Online
  3. Use the search text box to search for items in the selected location.

    Searching matches items with keywords in their title, tags, or summary.

  4. Click Filter Filter to sort the results, change the sort direction, and narrow the search results.

    The Filter available options depend on where you are searching for content, though some options are always available, such as Title and Item typeto sort by title or layers or tools, for example.

    When you click an item in the panel, another sidebar appears with information about the item. In this sidebar, you can expand Overview, Description, and Details for more information about the item. If the item contains multiple layers, expand Layers for more information about each layer. Click View item View item to open the item page for more information about the item.

Add content to the notebook

To add an item from the content browser panel to the notebook, click the item's Add button or the Insert into notebook button on the item's sidebar.

A new cell is created in the notebook below the currently selected cell. The item is listed with the information described in the subsections below.

Item

For all items other than web tools and big data file shares, the notebook assigns the item default variable to the item and displays the item as the cell's output when the cell is run.

Tip:

Rename the item variable something that uniquely identifies the item.


# Item Added From Toolbar
# Title: <item title> | Type: <item type> | Owner: <item owner>
item = gis.content.get("<item ID>")
item

Web tool

If the item is a web tool, the notebook imports the geoprocessing toolbox as a Python module that you can use with your content. If you intend to add multiple web tools to the notebook, rename the my_toolbox variable as a unique identifier.

Tip:

Uncomment the last line to display the web tool's help documentation when the cell is run.


# Item Added From Toolbar
# Title: <tool title> | Type: <tool type> | Owner: <tool owner>
from arcgis.geoprocessing import import_toolbox
web_tool_item = gis.content.get("<item ID of tool>")
my_toolbox = import_toolbox(web_tool_item)
# help(my_toolbox)

Big data file share

If the item is a big data file share, the notebook assigns the file_share default variable to the item and displays the item as the cell's output when the cell is run.

Tip:

Rename the file_share variable something that uniquely identifies the item.

# Item Added From Toolbar
# Title: <big data file share title> | Type: <item type> | Owner: <item owner>
file_share = gis.content.get("<item ID of layer>")
file_share