<?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: Trouble Understanding Get Count in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/trouble-understanding-get-count/m-p/836731#M2793</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Quick update. I changed over to the following python script:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
locno &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameterAsText&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;
year &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; locno&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;7&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"O:/plan/luam/1p2007/"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; year &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"/"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; locno &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"/data_for_item.gdb"&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; workspace
inFc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'in_memory\AddressSelect'&lt;/SPAN&gt;
numRecords &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; int&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetCount_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inFc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getOutput&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="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; numRecords &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddError&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Incorrect address. Please try again.'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;False&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; result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&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; result&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;/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;I tried it both using AddWarning and AddError.&lt;/P&gt;&lt;P&gt;AddWarning gives the following to the output then continues to run through all tools/scripts providing either the message 'precondition is false' or 'inputs are not current':&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="270084" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/270084_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;AddError provides the following, and seems to be a bit 'cleaner' and I think easier for the end user to know that something is not right:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="270085" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/270085_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;Something I find interesting is the script with AddWarning does display as Completed at the top left of the form while the AddError script shows Executing Test For Records... is that because in the case of AddWarning, the model did complete and with AddError it did not?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 10:09:45 GMT</pubDate>
    <dc:creator>ChrisHolmes</dc:creator>
    <dc:date>2021-12-12T10:09:45Z</dc:date>
    <item>
      <title>Trouble Understanding Get Count</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/trouble-understanding-get-count/m-p/836726#M2788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good day everyone,&lt;/P&gt;&lt;P&gt;I think I'm having some trouble understanding how to make use of Get Count. I have the following:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/269479_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;What I want to see happen is if Row Count = 0 &amp;gt; End the model. If Row Count &amp;gt; 0 continue the model. What I see is when Row Count &amp;gt; 0 the model continues and when Row Count = 0 it just seems to spin it's wheels for a bit (30 seconds) then end. I don't know if maybe it has something to do with Select Layer By Location using AddressSelect as it's Selecting Features? Or maybe I'm just using Get Count completely wrong and there's a different way I should be approaching this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help,&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2016 16:07:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/trouble-understanding-get-count/m-p/836726#M2788</guid>
      <dc:creator>ChrisHolmes</dc:creator>
      <dc:date>2016-11-22T16:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble Understanding Get Count</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/trouble-understanding-get-count/m-p/836727#M2789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Upon further investigation, it looks like maybe it is working. When Row Count = 0 it continues going through all tools/scripts it just doesn't execute them, due to either "precondition is false" or "inputs are not current". The following is what is displayed. Now that I think it's working, would there be a way to add in a arcpy.AddWarning("Incorrect address, try again") in addition to or in lieu of all of the precondition is false... inputs are not current...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Executing: FinalModel22 "7 windermure rd sw" M-4&lt;/P&gt;&lt;P&gt;Start Time: Tue Nov 22 13:01:22 2016&lt;/P&gt;&lt;DIR&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;P&gt;Executing (GetLocNo): GetLocNo&lt;/P&gt;&lt;P&gt;Start Time: Tue Nov 22 13:01:23 2016&lt;/P&gt;&lt;P&gt;Running script GetLocNo...&lt;/P&gt;&lt;P&gt;Completed script GetLocNo...&lt;/P&gt;&lt;P&gt;Succeeded at Tue Nov 22 13:01:25 2016 (Elapsed Time: 2.50 seconds)&lt;/P&gt;&lt;P&gt;Executing (Select): Select "Construction Layers\CALGIS.ADDRESS_POSSE" in_memory\AddressSelect "ADDRESS =UPPER('7 windermure rd sw')"&lt;/P&gt;&lt;P&gt;Start Time: Tue Nov 22 13:01:25 2016&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: small;"&gt;WARNING &lt;/SPAN&gt;&lt;SPAN style="color: #700000; font-size: small;"&gt;000117&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small;"&gt;: Warning empty output generated.&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="color: #008000; font-size: small;"&gt; &lt;/SPAN&gt;&lt;P&gt;Succeeded at Tue Nov 22 13:01:26 2016 (Elapsed Time: 0.73 seconds)&lt;/P&gt;&lt;P&gt;Executing (Get Count): GetCount in_memory\AddressSelect&lt;/P&gt;&lt;P&gt;Start Time: Tue Nov 22 13:01:26 2016&lt;/P&gt;&lt;P&gt;Row Count = 0&lt;/P&gt;&lt;P&gt;Succeeded at Tue Nov 22 13:01:26 2016 (Elapsed Time: 0.00 seconds)&lt;/P&gt;&lt;P&gt;Executing (Select Layer By Location): SelectLayerByLocation "Construction Layers\OPF - Ownership Parcel Fabric\CALGIS.OPF_PARCEL" INTERSECT in_memory\AddressSelect # NEW_SELECTION&lt;/P&gt;&lt;P&gt;Start Time: Tue Nov 22 13:01:26 2016&lt;/P&gt;&lt;P&gt;The process did not execute because the precondition is false.&lt;/P&gt;&lt;P&gt;Succeeded at Tue Nov 22 13:01:26 2016 (Elapsed Time: 0.00 seconds)&lt;/P&gt;&lt;P&gt;Executing (Zoom To Selected Feature): ZoomToSelected&lt;/P&gt;&lt;P&gt;Start Time: Tue Nov 22 13:01:26 2016&lt;/P&gt;&lt;P&gt;All the inputs are not current.&lt;/P&gt;&lt;P&gt;Succeeded at Tue Nov 22 13:01:26 2016 (Elapsed Time: 0.00 seconds)&lt;/P&gt;&lt;P&gt;Executing (Append): Append 'Construction Layers\OPF - Ownership Parcel Fabric\CALGIS.OPF_PARCEL' site_polygon NO_TEST # #&lt;/P&gt;&lt;P&gt;Start Time: Tue Nov 22 13:01:26 2016&lt;/P&gt;&lt;P&gt;All the inputs are not current.&lt;/P&gt;&lt;P&gt;Succeeded at Tue Nov 22 13:01:26 2016 (Elapsed Time: 0.00 seconds)&lt;/P&gt;&lt;P&gt;Executing (Append (2)): Append 'Construction Layers\OPF - Ownership Parcel Fabric\CALGIS.OPF_PARCEL' "PROPOSED - proposed_LUD_polygon - OUTLINE" NO_TEST # #&lt;/P&gt;&lt;P&gt;Start Time: Tue Nov 22 13:01:26 2016&lt;/P&gt;&lt;P&gt;All the inputs are not current.&lt;/P&gt;&lt;P&gt;Succeeded at Tue Nov 22 13:01:26 2016 (Elapsed Time: 0.00 seconds)&lt;/P&gt;&lt;P&gt;Executing (Update Proposed Lud Polygon Info): UpdateProposedLudPolygonInfo LOC2017-0016 M-4&lt;/P&gt;&lt;P&gt;Start Time: Tue Nov 22 13:01:26 2016&lt;/P&gt;&lt;P&gt;All the inputs are not current.&lt;/P&gt;&lt;P&gt;Succeeded at Tue Nov 22 13:01:26 2016 (Elapsed Time: 0.00 seconds)&lt;/P&gt;&lt;P&gt;Executing (Update Site Polygon Info): UpdateSitePolygonInfo LOC2017-0016&lt;/P&gt;&lt;P&gt;Start Time: Tue Nov 22 13:01:26 2016&lt;/P&gt;&lt;P&gt;All the inputs are not current.&lt;/P&gt;&lt;P&gt;Succeeded at Tue Nov 22 13:01:26 2016 (Elapsed Time: 0.00 seconds)&lt;/P&gt;&lt;P&gt;Executing (Set Scale): SetScale400&lt;/P&gt;&lt;P&gt;Start Time: Tue Nov 22 13:01:26 2016&lt;/P&gt;&lt;P&gt;All the inputs are not current.&lt;/P&gt;&lt;P&gt;Succeeded at Tue Nov 22 13:01:26 2016 (Elapsed Time: 0.00 seconds)&lt;/P&gt;&lt;P&gt;Executing (Create Site Location): CreateSiteLocation #&lt;/P&gt;&lt;P&gt;Start Time: Tue Nov 22 13:01:26 2016&lt;/P&gt;&lt;P&gt;All the inputs are not current.&lt;/P&gt;&lt;P&gt;Succeeded at Tue Nov 22 13:01:26 2016 (Elapsed Time: 0.00 seconds)&lt;/P&gt;&lt;/DIR&gt;&lt;P&gt;Succeeded at Tue Nov 22 13:01:26 2016 (Elapsed Time: 3.44 seconds)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2016 20:14:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/trouble-understanding-get-count/m-p/836727#M2789</guid>
      <dc:creator>ChrisHolmes</dc:creator>
      <dc:date>2016-11-22T20:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble Understanding Get Count</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/trouble-understanding-get-count/m-p/836728#M2790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The output of the Get Count tool is of type integer, which when it has the value of zero is interpreted as false when linked to the next tool in the chain as a precondition.&amp;nbsp; This can cause problems when you want the tool to &lt;EM&gt;continue&lt;/EM&gt; when the count is zero. In situations like that you are better off running the Get Count inside a Python function (arcpy.GetCount_management(lyr)) in the Calculate Value tool (that is, hiding the results from the Model Builder) and returning true or false as Boolean based on the Get Count result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 03:19:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/trouble-understanding-get-count/m-p/836728#M2790</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2016-11-23T03:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble Understanding Get Count</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/trouble-understanding-get-count/m-p/836729#M2791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In response to this question:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Could there be a way to add in a arcpy.AddWarning("Incorrect address, try again") in addition to or in lieu of all of the precondition is false... inputs are not current...&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Without &lt;A href="https://blogs.esri.com/esri/arcgis/2011/09/12/modelbuilderifthenelse3/" rel="nofollow noopener noreferrer" target="_blank"&gt;building a python script to print the messages,&lt;/A&gt; you can do this in the Calculate Value tool. I have discovered you cannot embed "\n" in the Calculate value tool; I use chr(12) instead to print newlines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;test&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"%AddressSelect%"&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Code Block:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;test&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lyr&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp; 
&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetCount_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lyr&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getOutput&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="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"0"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"{0}{0}Incorrect address{0}{0}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;chr&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;12&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data Type: String&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will print (in the middle of your messages):&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;

Incorrect Address

‍‍‍‍‍‍‍‍&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I think no matter what you do you'll see all those warning messages about inputs not current. If you really want full control of messages, you need to start thinking about Python scripting. Model Builder is awesome, but it has its limits.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:09:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/trouble-understanding-get-count/m-p/836729#M2791</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-12T10:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble Understanding Get Count</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/trouble-understanding-get-count/m-p/836730#M2792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Super. Thanks for your time Curtis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sent from my iPhone&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 03:42:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/trouble-understanding-get-count/m-p/836730#M2792</guid>
      <dc:creator>ChrisHolmes</dc:creator>
      <dc:date>2016-11-23T03:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble Understanding Get Count</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/trouble-understanding-get-count/m-p/836731#M2793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Quick update. I changed over to the following python script:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
locno &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameterAsText&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;
year &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; locno&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;7&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"O:/plan/luam/1p2007/"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; year &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"/"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; locno &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"/data_for_item.gdb"&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; workspace
inFc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'in_memory\AddressSelect'&lt;/SPAN&gt;
numRecords &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; int&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetCount_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inFc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getOutput&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="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; numRecords &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddError&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Incorrect address. Please try again.'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;False&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; result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&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; result&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;/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;I tried it both using AddWarning and AddError.&lt;/P&gt;&lt;P&gt;AddWarning gives the following to the output then continues to run through all tools/scripts providing either the message 'precondition is false' or 'inputs are not current':&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="270084" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/270084_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;AddError provides the following, and seems to be a bit 'cleaner' and I think easier for the end user to know that something is not right:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="270085" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/270085_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;Something I find interesting is the script with AddWarning does display as Completed at the top left of the form while the AddError script shows Executing Test For Records... is that because in the case of AddWarning, the model did complete and with AddError it did not?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:09:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/trouble-understanding-get-count/m-p/836731#M2793</guid>
      <dc:creator>ChrisHolmes</dc:creator>
      <dc:date>2021-12-12T10:09:45Z</dc:date>
    </item>
  </channel>
</rss>

