<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Error of python code in ArcGIS Online Notebook in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-of-python-code-in-arcgis-online-notebook/m-p/1244246#M8227</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I am running this code on AGOL Notebook but I am getting error. The code is from Esri website&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en/technical-article/000016853" target="_blank"&gt;https://support.esri.com/en/technical-article/000016853&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I don't know why I am getting this error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="anonymous55_0-1672329278824.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/59440i61BD27B999E3B868/image-size/medium?v=v2&amp;amp;px=400" role="button" title="anonymous55_0-1672329278824.png" alt="anonymous55_0-1672329278824.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Dec 2022 15:57:51 GMT</pubDate>
    <dc:creator>anonymous55</dc:creator>
    <dc:date>2022-12-29T15:57:51Z</dc:date>
    <item>
      <title>Error of python code in ArcGIS Online Notebook</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-of-python-code-in-arcgis-online-notebook/m-p/1244246#M8227</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I am running this code on AGOL Notebook but I am getting error. The code is from Esri website&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en/technical-article/000016853" target="_blank"&gt;https://support.esri.com/en/technical-article/000016853&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I don't know why I am getting this error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="anonymous55_0-1672329278824.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/59440i61BD27B999E3B868/image-size/medium?v=v2&amp;amp;px=400" role="button" title="anonymous55_0-1672329278824.png" alt="anonymous55_0-1672329278824.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2022 15:57:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-of-python-code-in-arcgis-online-notebook/m-p/1244246#M8227</guid>
      <dc:creator>anonymous55</dc:creator>
      <dc:date>2022-12-29T15:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Error of python code in ArcGIS Online Notebook</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-of-python-code-in-arcgis-online-notebook/m-p/1244265#M8228</link>
      <description>&lt;P&gt;what did you provide for steps 1 and 2 in your link?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2022 17:00:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-of-python-code-in-arcgis-online-notebook/m-p/1244265#M8228</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-12-29T17:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: Error of python code in ArcGIS Online Notebook</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-of-python-code-in-arcgis-online-notebook/m-p/1244271#M8229</link>
      <description>&lt;P&gt;This is exact code on blog except I am running it on Notbook on arcgis online. Then I didn't provide password and a portal url just user name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;import arcgis
from arcgis.gis import GIS

user = "UserName" ##My User name

##for web maps
webmaps = gis.content.search("owner:" + user, item_type="Web Map", max_items=10)
webmaps

##for feature layers 
fcs = gis.content.search("owner:" + user, item_type="Feature Layer", max_items=10)
fcs

##for feature layers
fcs.url
fc_layers = fcs.layers
fc_layers.url

##for web maps
web_map_obj = arcgis.mapping.WebMap(webmaps)
maplayers = web_map_obj['operationalLayers']
maplayers['url']&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2022 17:19:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-of-python-code-in-arcgis-online-notebook/m-p/1244271#M8229</guid>
      <dc:creator>anonymous55</dc:creator>
      <dc:date>2022-12-29T17:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Error of python code in ArcGIS Online Notebook</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-of-python-code-in-arcgis-online-notebook/m-p/1244536#M8231</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/195450"&gt;@anonymous55&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Have u tried working with for loops and/or list indexes?&lt;/P&gt;&lt;P&gt;In the example, they probably have only 1 webmap and 1 feature layer. If you have multiple webmaps en feature layers, the result of gis.content.search will be stored as a list.&lt;/P&gt;&lt;P&gt;To extract all feature layer URLs you can for example try:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;for i in fcs:
    print(i.url)&lt;/LI-CODE&gt;&lt;P&gt;It is also possible to work with list indices.&lt;/P&gt;&lt;P&gt;Hope this will help you out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2022 13:38:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-of-python-code-in-arcgis-online-notebook/m-p/1244536#M8231</guid>
      <dc:creator>AntoinevanEsch</dc:creator>
      <dc:date>2022-12-30T13:38:53Z</dc:date>
    </item>
  </channel>
</rss>

