<?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: How to identify if 0 records are selected in a layer using python in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787239#M1464</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you please share the code, I am running into the same problem. Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Apr 2018 15:31:11 GMT</pubDate>
    <dc:creator>MattDriscoll1</dc:creator>
    <dc:date>2018-04-27T15:31:11Z</dc:date>
    <item>
      <title>How to identify if 0 records are selected in a layer using python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787226#M1451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am currently working on a script that reads the number of features selected in a layer and returns a message or does a function based on how many records are selected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If 0 are selected:&amp;nbsp; it tells the user to "make a selection"&lt;/P&gt;&lt;P&gt;If &amp;gt;10, it tells users "too many features selected, must be less than 10"&lt;/P&gt;&lt;P&gt;If they select between 1-10 features, it runs the rest of the function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following logic:&lt;/P&gt;&lt;P&gt;features = int(arcpy.GetCount_management (featureLayer).getOutput(0))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if features&amp;lt;1:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;arcpy.addmessage(msg1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;elif features&amp;gt;10:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;arcpy.addmessage(msg2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else:&lt;/P&gt;&lt;P&gt;function proceeds....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue with this logic is that if no features are selected (&lt;SPAN&gt;if features&amp;lt;1:) it reads it as the count of the entire feature class and so returns msg2.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried instead to use the logic of&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;desc = arcpy.Describe (Featureclass)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if desc.FIDset ==' ':&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;arcpy.addmessage (msg1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This second logic works in ArcGIS desktop, but will not work in AGOL if I publish as a Geoprocessing service.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can anyone think of any workarounds that will recognize if 0 records are selected?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2017 20:06:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787226#M1451</guid>
      <dc:creator>AhnaMiller2</dc:creator>
      <dc:date>2017-11-07T20:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify if 0 records are selected in a layer using python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787227#M1452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/get-count.htm"&gt;&lt;STRONG&gt;GetCount_management&lt;/STRONG&gt;&lt;/A&gt; is one way&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2017 20:07:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787227#M1452</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-11-07T20:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify if 0 records are selected in a layer using python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787228#M1453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan, the issue with GetCount_management is that if I have nothing selected, it sees all the records in the layer so it retruns message 2 (too many features selected) instead of message1 (no features selected)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2017 20:11:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787228#M1453</guid>
      <dc:creator>AhnaMiller2</dc:creator>
      <dc:date>2017-11-07T20:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify if 0 records are selected in a layer using python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787229#M1454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I haven't tried this with AGOL data, but getSelectionSet() on the arcpy.mapping.Layer class might be worth a look.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2017 20:25:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787229#M1454</guid>
      <dc:creator>JamesMacKay3</dc:creator>
      <dc:date>2017-11-07T20:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify if 0 records are selected in a layer using python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787230#M1455</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;CODE&gt;&lt;SPAN class="keyword token"&gt;while&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; n &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; input&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Enter a number between 1 and 10:&amp;nbsp; "&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; int&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;n&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; int&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;n&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;11&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'done'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;break&lt;/SPAN&gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; 

Enter a number between &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;10&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;

Enter a number between &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;10&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="number token"&gt;11&lt;/SPAN&gt;

Enter a number between &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;10&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;


done
&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;/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;P&gt;then&amp;nbsp; you could switch the idea up a bit in a while loop perhaps&amp;nbsp; while&amp;nbsp;&lt;/P&gt;&lt;P&gt;But you mentioned agol... hmmm don't do it, but the logic is&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:59:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787230#M1455</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T08:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify if 0 records are selected in a layer using python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787231#M1456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/248911" target="_blank"&gt;Ahna Miller&lt;/A&gt;&amp;nbsp;, can you clarify where you want to execute the Python code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you use:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;desc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Describe&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Featureclass&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; desc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FIDset &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;''&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# you have a selection&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Number of selected features: {}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;len&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;desc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FIDSet&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;";"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&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;P&gt;you should not pass in a "FeatureClass" (reference to a featureclass stored on disk) since it will never have a selection. You will have to reference a layer in a ArcMap or ArcGIS Pro session to make this work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your comment:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;EM&gt;This second logic works in ArcGIS desktop, but will not work in AGOL if I publish as a Geoprocessing service.&lt;/EM&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;... has confused me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are two things that needs clarification:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;"&lt;EM&gt;will not work in AGOL&lt;/EM&gt;"; are you loading a hosted feature service in Desktop and run the code in desktop?&lt;/LI&gt;&lt;LI&gt;"&lt;EM&gt;if I publish as a Geoprocessing service&lt;/EM&gt;"; where is the geoprocessing service published? Not is AGOL because as far as I know you can only publish this in server.&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you posted this question in the ArcGIS Python API space, you might be working with this API in a Jupyter notebook, but then the question arises if you would reference a web map with your layer&amp;nbsp;how will you make the selection? So my question is, what is your specific use case, what would you like to achieve and where and for whom?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:59:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787231#M1456</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-12T08:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify if 0 records are selected in a layer using python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787232#M1457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xander,&lt;/P&gt;&lt;P&gt;To clarify- I am attempting to use this python code as a geoprocessing tool in AGOL webapp builder. I test from desktop before publishing as a GP service, but ultimately the script needs to work as a GP service from the geoprocessing widget in WAB.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2017 17:40:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787232#M1457</guid>
      <dc:creator>AhnaMiller2</dc:creator>
      <dc:date>2017-11-16T17:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify if 0 records are selected in a layer using python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787233#M1458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So,&amp;nbsp;I still have a question about which selection made where should be detected by the GP service executed in WAB? It should detect the selection made in the WAB by the current user?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2017 17:53:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787233#M1458</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2017-11-16T17:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify if 0 records are selected in a layer using python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787234#M1459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/people/xander_bakker"&gt;xander_bakker&lt;/A&gt;‌ , yes. It should detect the selection made in the WAB by the current user.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2017 18:24:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787234#M1459</guid>
      <dc:creator>AhnaMiller2</dc:creator>
      <dc:date>2017-11-20T18:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify if 0 records are selected in a layer using python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787235#M1460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think a GP service run at the server is capable of detecting a selection that "lives" at a client. You should probably code this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me tag &lt;A href="https://community.esri.com/people/rscheitlin"&gt;rscheitlin&lt;/A&gt;‌ and &lt;A href="https://community.esri.com/people/rastrauch"&gt;rastrauch&lt;/A&gt; who will probably have an answer to this.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2017 22:11:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787235#M1460</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2017-11-20T22:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify if 0 records are selected in a layer using python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787236#M1461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes I have to agree with Xander here, I do not think it is possible for a GP process to know of a client side selection in WAB using the GP Widget.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Nov 2017 02:38:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787236#M1461</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-11-21T02:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify if 0 records are selected in a layer using python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787237#M1462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ahna, curious if you found a solution?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2018 00:02:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787237#M1462</guid>
      <dc:creator>ChrisHolmes</dc:creator>
      <dc:date>2018-02-23T00:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify if 0 records are selected in a layer using python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787238#M1463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Chris, I ended up using a work around that identified a range of features a user could select and run the function for.My database had more than 20000 features, so I set that a selection range had to be between 1 &amp;amp; 200, If a user did not select anything, it would read it as if all 20000 features were selected &amp;amp; so the function would not run. Not the most ideal solution, but a work around nonetheless. I'd be happy to share this part of the code logic with you if it would help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2018 16:03:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787238#M1463</guid>
      <dc:creator>AhnaMiller2</dc:creator>
      <dc:date>2018-03-02T16:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify if 0 records are selected in a layer using python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787239#M1464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you please share the code, I am running into the same problem. Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2018 15:31:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787239#M1464</guid>
      <dc:creator>MattDriscoll1</dc:creator>
      <dc:date>2018-04-27T15:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify if 0 records are selected in a layer using python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787240#M1465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;Matt,&lt;/P&gt;&lt;P&gt;Here's the code&amp;nbsp; I ended up using to get around this- I basically set it so that a user had to select between 1 - ### features to run the script. This way, if a user does not select between 1 and ##(say 25) , the&amp;nbsp; script will attempt to run on the entire data set, which will then throw the error message in Line 12&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;featureLayer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameter&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;#this line respects the selection&lt;/SPAN&gt;
listA &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;##Add selected features to listA as needed&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; len&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;listA&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; range &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;26&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;#this is the line that ensures something gets selected as long as the dataset is more than 25 features&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UpdateCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;insertlayerhere&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;comma separated fields here&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; uc&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; uc&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;uc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;updateRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;msg1&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"OBJECTID(s) {0} will be InsertActionHere"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;listA&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;msg1&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Please select between 1 and 25 valid features."&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#pass message 1&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SetParameterAsText&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; msg1&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

&lt;SPAN class="string token"&gt;""""
instead of line ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍6 / passing everything into a list the following code also works:
&amp;nbsp;&amp;nbsp; features = int(arcpy.GetCount_management(featureLayer).getOutput(0))‍


"""&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;/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;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;P&gt;&lt;/P&gt;&lt;P&gt;Hope this makes sense, let me know if not, I'd be happy to discuss further!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:59:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-identify-if-0-records-are-selected-in-a/m-p/787240#M1465</guid>
      <dc:creator>AhnaMiller2</dc:creator>
      <dc:date>2021-12-12T08:59:18Z</dc:date>
    </item>
  </channel>
</rss>

