Skip To Content

Add items to a notebook

The notebook editor provides a sidebar where you can browse, search, and add portal items such as layers and web tools to your 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 publicly available in ArcGIS Online or ArcGIS Living Atlas of the World.

Note:

Because OGC services (such as WMS and WFS) are not compatible with ArcGIS API for Python, these services and any portal items referencing OGC services are not supported in notebooks.

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 button 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 will match items with keywords in their title, tags, or summary.

  4. Below the search bar, click the Compact view button to view only the item titles of displayed content, or click the List view button to view item type, owner, date of last update, and any labels the item includes (authoritative, deprecated, or Esri-curated).
  5. Optionally filter displayed items by attribute, and sort the content by category.

    The Filter and Sort options available depend on the content location you selected, though some options are always available, such as filtering by Item Type (such as layers or tools) and sorting by Title.

    When you click an item in the panel, another sidebar opens with information about the item. In this sidebar, you can read the item summary, description, terms of use, and attribution. You can also see its view count, creation date, and sharing settings.

Add content to your notebook

To add an item from the content browser panel to your notebook, click the item's Add button or click Add to Notebook.

Add to Notebook button

A new cell is created in your 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 tools

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 your 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 shares

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