<?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: If statement for particular column (ArcGIS Online) in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/if-statement-for-particular-column-arcgis-online/m-p/727973#M56444</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just in case this is the reason, use&amp;nbsp;&amp;nbsp; arcpy.AddMessage("Yes")&amp;nbsp;&amp;nbsp;&amp;nbsp; and maybe a option to print something for the else:&amp;nbsp;&amp;nbsp; That may help debug.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On a side note, because I switch often between the python window and scripts, I have a function that I use that will handle it in either environment (sometimes it will duplicate the message).&amp;nbsp; fwiw&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# shows messages for python window or tool&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;myMsgs&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;message&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddMessage&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;message&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;message&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 07:07:32 GMT</pubDate>
    <dc:creator>RebeccaStrauch__GISP</dc:creator>
    <dc:date>2021-12-12T07:07:32Z</dc:date>
    <item>
      <title>If statement for particular column (ArcGIS Online)</title>
      <link>https://community.esri.com/t5/python-questions/if-statement-for-particular-column-arcgis-online/m-p/727972#M56443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN lang="en"&gt;Hello, I am currently working on a script that gets data from a hosted 
ArcGIS Online feature class.&amp;nbsp; The plan is to go from top to bottom in a particular 
column, and for every value X to execute a print command.&amp;nbsp; I've already managed 
this with local files:

fc = r'C:/...'
fields = ['F_03']
with arcpy.da.UpdateCursor(fc, fields) as cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if row[0] == "X":&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print("Yes")

Which will only work with ArcMap and not as standalone script I think. 
Also I've already established the "connection" to my hosted feature class with 
requests.get(URL). But I can't figure out, how to put those two snippets 
together so it will actually work.&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:07:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/if-statement-for-particular-column-arcgis-online/m-p/727972#M56443</guid>
      <dc:creator>DominikVisca1</dc:creator>
      <dc:date>2021-12-12T07:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: If statement for particular column (ArcGIS Online)</title>
      <link>https://community.esri.com/t5/python-questions/if-statement-for-particular-column-arcgis-online/m-p/727973#M56444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just in case this is the reason, use&amp;nbsp;&amp;nbsp; arcpy.AddMessage("Yes")&amp;nbsp;&amp;nbsp;&amp;nbsp; and maybe a option to print something for the else:&amp;nbsp;&amp;nbsp; That may help debug.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On a side note, because I switch often between the python window and scripts, I have a function that I use that will handle it in either environment (sometimes it will duplicate the message).&amp;nbsp; fwiw&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# shows messages for python window or tool&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;myMsgs&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;message&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddMessage&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;message&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;message&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:07:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/if-statement-for-particular-column-arcgis-online/m-p/727973#M56444</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2021-12-12T07:07:32Z</dc:date>
    </item>
  </channel>
</rss>

