<?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 Write to Variables from Query in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/write-to-variables-from-query/m-p/1271096#M8541</link>
    <description>&lt;P&gt;I am doing a query of my Portal Items like below and get the result like below.&lt;/P&gt;&lt;P&gt;I want to take this a bit further and test the "Item Title" and only process a few of the returned items&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;search_result = source.content.search(query="owner:"+str(source_owner), item_type="Web Map")

for item in search_result:
    app=source.content.get(item.id)
    data = [app]
    print(data)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result&lt;/P&gt;&lt;LI-CODE lang="c"&gt;[&amp;lt;Item title:"AAH Demo Public" type:Web Map owner:someone&amp;gt;]
[&amp;lt;Item title:"AAH Demo" type:Web Map owner:someone&amp;gt;]
[&amp;lt;Item title:"AAH Demo Live Test" type:Web Map owner:someone&amp;gt;]
[&amp;lt;Item title:"AAH Demo" type:Web Map owner:someone&amp;gt;]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I get Item title to a variable?&lt;/P&gt;&lt;P&gt;print(data.title)&lt;/P&gt;&lt;P&gt;or something like that..... Not sure how to read that returned format into anything????&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thoughts&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Mar 2023 19:28:25 GMT</pubDate>
    <dc:creator>kapalczynski</dc:creator>
    <dc:date>2023-03-23T19:28:25Z</dc:date>
    <item>
      <title>Write to Variables from Query</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/write-to-variables-from-query/m-p/1271096#M8541</link>
      <description>&lt;P&gt;I am doing a query of my Portal Items like below and get the result like below.&lt;/P&gt;&lt;P&gt;I want to take this a bit further and test the "Item Title" and only process a few of the returned items&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;search_result = source.content.search(query="owner:"+str(source_owner), item_type="Web Map")

for item in search_result:
    app=source.content.get(item.id)
    data = [app]
    print(data)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result&lt;/P&gt;&lt;LI-CODE lang="c"&gt;[&amp;lt;Item title:"AAH Demo Public" type:Web Map owner:someone&amp;gt;]
[&amp;lt;Item title:"AAH Demo" type:Web Map owner:someone&amp;gt;]
[&amp;lt;Item title:"AAH Demo Live Test" type:Web Map owner:someone&amp;gt;]
[&amp;lt;Item title:"AAH Demo" type:Web Map owner:someone&amp;gt;]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I get Item title to a variable?&lt;/P&gt;&lt;P&gt;print(data.title)&lt;/P&gt;&lt;P&gt;or something like that..... Not sure how to read that returned format into anything????&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thoughts&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 19:28:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/write-to-variables-from-query/m-p/1271096#M8541</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2023-03-23T19:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Write to Variables from Query</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/write-to-variables-from-query/m-p/1271108#M8542</link>
      <description>&lt;LI-CODE lang="python"&gt;for item in search_result:
    print(item.title)&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1679600077862.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/66146iAF5EFB0CE594DA3E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1679600077862.png" alt="jcarlson_0-1679600077862.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The list &lt;STRONG&gt;search_result&lt;/STRONG&gt; already has the title as a property of each &lt;STRONG&gt;Item &lt;/STRONG&gt;in it. You can reference the title directly in your loop.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 19:35:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/write-to-variables-from-query/m-p/1271108#M8542</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2023-03-23T19:35:43Z</dc:date>
    </item>
  </channel>
</rss>

