<?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 Re: Filter layer inside webmap in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-layer-inside-webmap/m-p/806505#M2288</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jeff,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the quick feedback!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the solution you provided but for some reason, the get_data() method returns None..&lt;/P&gt;&lt;P&gt;I`d also like to point out that in the solution you provided, the item is obtained by searching the content and retrieving the Feature Layer; in my case, I have an operational layer in a web map; not sure if it`s the same thing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I can see, the sql expression is mounted on definitionExpression on the object, but in my case I cannot find this property on the layer object from my webmap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ionut&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Sep 2018 09:15:35 GMT</pubDate>
    <dc:creator>IonutAlixandroae3</dc:creator>
    <dc:date>2018-09-05T09:15:35Z</dc:date>
    <item>
      <title>Filter layer inside webmap</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-layer-inside-webmap/m-p/806503#M2286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a posibility to filter an operational layer inside a webmap (similar to what definition query does in ArcMap) and after to save the webmap with the new updates?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I`m at the step where I iterate through my layers from my map but I cannot find the solution to apply a filter/definition query to them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/420966_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ionut&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2018 13:53:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-layer-inside-webmap/m-p/806503#M2286</guid>
      <dc:creator>IonutAlixandroae3</dc:creator>
      <dc:date>2018-09-03T13:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: Filter layer inside webmap</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-layer-inside-webmap/m-p/806504#M2287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ionut,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take a look at the following post, the question is similar, although it was in regards to a single layer.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/206220-how-to-add-a-filter-to-an-arcgis-online-item-using-the-python-api"&gt;https://community.esri.com/thread/206220-how-to-add-a-filter-to-an-arcgis-online-item-using-the-python-api&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jeff&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2018 15:25:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-layer-inside-webmap/m-p/806504#M2287</guid>
      <dc:creator>JeffBigos</dc:creator>
      <dc:date>2018-09-04T15:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Filter layer inside webmap</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-layer-inside-webmap/m-p/806505#M2288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jeff,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the quick feedback!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the solution you provided but for some reason, the get_data() method returns None..&lt;/P&gt;&lt;P&gt;I`d also like to point out that in the solution you provided, the item is obtained by searching the content and retrieving the Feature Layer; in my case, I have an operational layer in a web map; not sure if it`s the same thing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I can see, the sql expression is mounted on definitionExpression on the object, but in my case I cannot find this property on the layer object from my webmap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ionut&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2018 09:15:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-layer-inside-webmap/m-p/806505#M2288</guid>
      <dc:creator>IonutAlixandroae3</dc:creator>
      <dc:date>2018-09-05T09:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: Filter layer inside webmap</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-layer-inside-webmap/m-p/806506#M2289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;UPDATE:&lt;/P&gt;&lt;P&gt;You were right, I`ve used your solution to get a workflow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I`ve managed to iterate through layers in the webmap, and for each one, I`ve replace it with the same, just that I applied the definitionExpression on it; something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for layer in webMapLayers:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;layerTitle = layer.title&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;srcResults = adminGIS.content.search(layerTitle)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;featCollection = srcResults[0]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;sql = "sql filter"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;webMapItem.remove_layer(layer)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;webMapItem.add_layer(featCollection)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;webMapItem.layers[0]['layerDefinition']['definitionExpression'] = sql&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;webMapItem.update()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Ionut&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2018 14:07:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-layer-inside-webmap/m-p/806506#M2289</guid>
      <dc:creator>IonutAlixandroae3</dc:creator>
      <dc:date>2018-09-05T14:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: Filter layer inside webmap</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-layer-inside-webmap/m-p/806507#M2290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for looking at that a bit more, The code I had on there was for applying the filter to the featurelayer.&lt;/P&gt;&lt;P&gt;Below is another code block for how you can access a web map isolate a layer in a webmap and change the filter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To test the code below:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;create a basic webmap in your organization titled&amp;nbsp;&lt;STRONG&gt;TimeZoneRegions&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;Add the following featurelayer to the map&amp;nbsp;&amp;nbsp;&lt;A class="link-titled" href="https://sampleserver6.arcgisonline.com/arcgis/rest/services/WorldTimeZones/MapServer/2" title="https://sampleserver6.arcgisonline.com/arcgis/rest/services/WorldTimeZones/MapServer/2" rel="nofollow noopener noreferrer" target="_blank"&gt;Layer: World Regions (ID: 2)&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Save the map&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The one Dependency of the code below is the&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;WorldTimeZones - World Regions&lt;/STRONG&gt; operational layer in the webmap needs to have a filter set already.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;There is a block of code below that will check to see if a Layerdefinition exists on the operational layer before it gets applied:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if 'layerDefinition' in&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;tZone&lt;/SPAN&gt;&lt;SPAN&gt;Lyr&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;from &lt;/SPAN&gt;arcgis.gis &lt;SPAN style="color: #000080; font-weight: bold;"&gt;import &lt;/SPAN&gt;GIS
&lt;SPAN style="color: #000080; font-weight: bold;"&gt;import &lt;/SPAN&gt;copy
&lt;SPAN style="color: #000080; font-weight: bold;"&gt;from &lt;/SPAN&gt;json &lt;SPAN style="color: #000080; font-weight: bold;"&gt;import &lt;/SPAN&gt;dumps
&lt;SPAN style="color: #000080; font-weight: bold;"&gt;from &lt;/SPAN&gt;json &lt;SPAN style="color: #000080; font-weight: bold;"&gt;import &lt;/SPAN&gt;JSONDecoder
&lt;SPAN style="color: #000080; font-weight: bold;"&gt;from &lt;/SPAN&gt;arcgis.mapping &lt;SPAN style="color: #000080; font-weight: bold;"&gt;import &lt;/SPAN&gt;WebMap


&lt;SPAN style="color: #808080;"&gt;#Connect to the Organization
&lt;/SPAN&gt;gis = GIS(&lt;SPAN style="color: #008080; font-weight: bold;"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fwww.arcgis.com" target="_blank"&gt;https://www.arcgis.com&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;, &lt;SPAN style="color: #008080; font-weight: bold;"&gt;"&amp;lt;UserName&amp;gt;"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080; font-weight: bold;"&gt;"&amp;lt;passW&amp;gt;"&lt;/SPAN&gt;)


&lt;SPAN style="color: #808080;"&gt;#Search for the webmap&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;webmapPub = gis.content.search(&lt;SPAN style="color: #008080; font-weight: bold;"&gt;"title:TimeZoneRegions"&lt;/SPAN&gt;,&lt;SPAN style="color: #660099;"&gt;item_type &lt;/SPAN&gt;= &lt;SPAN style="color: #008080; font-weight: bold;"&gt;"Web Map"&lt;/SPAN&gt;)


&lt;SPAN style="color: #808080;"&gt;#Use a list comprehension to find the right one you are updating&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;timeZoneWebMap = [wmap &lt;SPAN style="color: #000080; font-weight: bold;"&gt;for &lt;/SPAN&gt;wmap &lt;SPAN style="color: #000080; font-weight: bold;"&gt;in &lt;/SPAN&gt;webmapPub &lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;wmap.title == &lt;SPAN style="color: #008080; font-weight: bold;"&gt;'TimeZoneRegions'&lt;/SPAN&gt;][&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;]


&lt;SPAN style="color: #808080;"&gt;#Get the webmap json&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;pubMapJson = timeZoneWebMap.get_data(&lt;SPAN style="color: #660099;"&gt;try_json&lt;/SPAN&gt;=&lt;SPAN style="color: #000080; font-weight: bold;"&gt;True&lt;/SPAN&gt;)


&lt;SPAN style="color: #808080;"&gt;# Filter Expression to apply to layer&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;lyrFilter = &lt;SPAN style="color: #008080; font-weight: bold;"&gt;"REGION = '{0}'"&lt;/SPAN&gt;.format(&lt;SPAN style="color: #008080; font-weight: bold;"&gt;"Antarctica"&lt;/SPAN&gt;)


&lt;SPAN style="color: #808080;"&gt;#Make a deepcopy of the json to modify&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;fldMapJsonCopy = copy.deepcopy(pubMapJson)


&lt;SPAN style="color: #808080;"&gt;#List comprehension to find the one layer you need to modify by title&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;#Here you could loop on all layers to modify the filter too.&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;lyrT = [l &lt;SPAN style="color: #000080; font-weight: bold;"&gt;for &lt;/SPAN&gt;l &lt;SPAN style="color: #000080; font-weight: bold;"&gt;in &lt;/SPAN&gt;pubMapJson[&lt;SPAN style="color: #008080; font-weight: bold;"&gt;'operationalLayers'&lt;/SPAN&gt;] &lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;l[&lt;SPAN style="color: #008080; font-weight: bold;"&gt;'title'&lt;/SPAN&gt;]== &lt;SPAN style="color: #008080; font-weight: bold;"&gt;'WorldTimeZones - World Regions'&lt;/SPAN&gt;]



&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;len&lt;/SPAN&gt;(lyrT) &amp;gt;&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;:
&amp;nbsp;&amp;nbsp;&amp;nbsp; tZoneLyr = lyrT[&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;]
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-weight: bold;"&gt;'layerDefinition' &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;in &lt;/SPAN&gt;tZoneLyr:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; z = [[x, y] &lt;SPAN style="color: #000080; font-weight: bold;"&gt;for &lt;/SPAN&gt;x, y &lt;SPAN style="color: #000080; font-weight: bold;"&gt;in &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;enumerate&lt;/SPAN&gt;(pubMapJson[&lt;SPAN style="color: #008080; font-weight: bold;"&gt;'operationalLayers'&lt;/SPAN&gt;]) &lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;y[&lt;SPAN style="color: #008080; font-weight: bold;"&gt;'title'&lt;/SPAN&gt;] == &lt;SPAN style="color: #008080; font-weight: bold;"&gt;'WorldTimeZones - World Regions'&lt;/SPAN&gt;][&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fldMapJsonCopy[&lt;SPAN style="color: #008080; font-weight: bold;"&gt;'operationalLayers'&lt;/SPAN&gt;][z[&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;]][&lt;SPAN style="color: #008080; font-weight: bold;"&gt;'layerDefinition'&lt;/SPAN&gt;][&lt;SPAN style="color: #008080; font-weight: bold;"&gt;'definitionExpression'&lt;/SPAN&gt;] = lyrFilter



&lt;SPAN style="color: #808080;"&gt;#Save the changes to the Webmap&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;timeZoneWebMap.update(&lt;SPAN style="color: #660099;"&gt;item_properties&lt;/SPAN&gt;={&lt;SPAN style="color: #008080; font-weight: bold;"&gt;'text'&lt;/SPAN&gt;:dumps(fldMapJsonCopy)})&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:24:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-layer-inside-webmap/m-p/806507#M2290</guid>
      <dc:creator>JeffBigos</dc:creator>
      <dc:date>2021-12-12T09:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Filter layer inside webmap</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-layer-inside-webmap/m-p/806508#M2291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jeff,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That`s sweet! Thanks a lot!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although, what if get_data() method on my layer returns None?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because that`s what happened to me and I had replace the original layer with itself but with a filter applied...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, thanks a lot for your feedback!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Ionut&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2018 06:34:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-layer-inside-webmap/m-p/806508#M2291</guid>
      <dc:creator>IonutAlixandroae3</dc:creator>
      <dc:date>2018-09-06T06:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: Filter layer inside webmap</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-layer-inside-webmap/m-p/806509#M2292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;EDIT: Just needed to use the data correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SOLUTION :&amp;nbsp;webMapItem.layers[len(webMapItem.layers) - 1]['layerDefinition']['drawingInfo'] = json.loads(str(simbol))&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where simbol is actualy the json data for symbology for the layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Jeff,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the same way 'definitionExpression' is set above, I`m trying to do with 'drawingInfo' property on the layer, but when I`m setting the info, I`m getting "Object of type 'PropertyMap' is not JSON serializable".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, I`m iterating every layer in the webmap, remove each one, and after add it again, set the 'layerDefinition''definitionExpression' to filter the data and after I`m trying to also set the intial symbol, but somehow it`s not working...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ionut&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2018 09:32:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-layer-inside-webmap/m-p/806509#M2292</guid>
      <dc:creator>IonutAlixandroae3</dc:creator>
      <dc:date>2018-10-15T09:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Filter layer inside webmap</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-layer-inside-webmap/m-p/806510#M2293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/2972" target="_blank"&gt;Jeff Bigos&lt;/A&gt;‌&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;I'm looking to implement something nearly identical to this: modifying a filter to a feature layer within a web map and saving a new copy. I'm struggling to find what arguments (proper documentation) are expected for&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;fldMapJsonCopy[&lt;SPAN style="color: #008080; font-weight: bold;"&gt;'operationalLayers'&lt;/SPAN&gt;][z[&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;]][&lt;SPAN style="color: #008080; font-weight: bold;"&gt;'layerDefinition'&lt;/SPAN&gt;][&lt;SPAN style="color: #008080; font-weight: bold;"&gt;'definitionExpression'&lt;/SPAN&gt;] = lyrFilter&lt;/PRE&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;I've looked at your other example here and have tried to piece things together but I'm not having any luck. I don't fully understand what the enumeration process here is and don't think i need it. &lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gis &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; GIS
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; WebMap
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; json&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; copy
gis &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GIS&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"https://my/portal"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"UseMe"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"L1f3izGr@nd!"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

webMapSearch &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;search&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"title: NortheastFieldData2"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;item_type &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Web Map"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
pubMapJson &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; webMapTest&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get_data&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;try_json&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
layerMod &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;l &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; l &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; pubMapJson&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'operationalLayers'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; l &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'title'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'NortheastCruisePoints'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
lyrFilter &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"LVI_CODE = '{0}'"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"7532"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
fieldMapCopy &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; copy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;deepcopy&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;pubMapJson&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
fieldMapCopy&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'operationalLayers'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;layerMod&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'layerDefinition'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'definitionExpression'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;lyrFilter&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;
TypeError                                 Traceback &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;most recent call last&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;ipython&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;input&lt;SPAN class="number token"&gt;-37&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;aec78b329a7c&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;module&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; fieldMapCopy&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'operationalLayers'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;layerMod&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'layerDefinition'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'definitionExpression'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; lyrFilter

TypeError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; list indices must be integers &lt;SPAN class="operator token"&gt;or&lt;/SPAN&gt; slices&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; list&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:24:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-layer-inside-webmap/m-p/806510#M2293</guid>
      <dc:creator>ZacharyHart</dc:creator>
      <dc:date>2021-12-12T09:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: Filter layer inside webmap</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-layer-inside-webmap/m-p/806511#M2294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am late in replying, but the error is indicating the data you have is a list not a dictionary.&amp;nbsp; Check out if what you are getting is what you are expecting.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also notice that the index 'layerMod' of the 'operationalLayers' variable seems to be erroneous.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Dec 2019 00:03:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-layer-inside-webmap/m-p/806511#M2294</guid>
      <dc:creator>MaazaMekuria</dc:creator>
      <dc:date>2019-12-03T00:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: Filter layer inside webmap</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-layer-inside-webmap/m-p/806512#M2295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just can't find any reliable documentation about this. I have had a ticket open with tech support that's older than a month now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2019 19:21:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/filter-layer-inside-webmap/m-p/806512#M2295</guid>
      <dc:creator>ZacharyHart</dc:creator>
      <dc:date>2019-12-05T19:21:23Z</dc:date>
    </item>
  </channel>
</rss>

