<?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 do I display geocode results within messages section of script results? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-do-i-display-geocode-results-within-messages/m-p/754794#M58208</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;line 4 is suspect:&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;count &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; int&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;result&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;

count &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; int&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;result&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="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;My line 3 just worked for me....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 08:01:09 GMT</pubDate>
    <dc:creator>JoeBorgione</dc:creator>
    <dc:date>2021-12-12T08:01:09Z</dc:date>
    <item>
      <title>How do I display geocode results within messages section of script results?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-display-geocode-results-within-messages/m-p/754789#M58203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a script that accepts the input of four tables and then geocodes these tables. My goal is to display the name of the output feature class and the number of unmatched records for each iteration of geocoding. This information is displayed while the tool is running but to better the user experience I would like this info displayed after the script is finished.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Feb 2020 20:29:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-display-geocode-results-within-messages/m-p/754789#M58203</guid>
      <dc:creator>KyleCrawford2</dc:creator>
      <dc:date>2020-02-17T20:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I display geocode results within messages section of script results?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-display-geocode-results-within-messages/m-p/754790#M58204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/functions/addmessage.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/functions/addmessage.htm"&gt;AddMessage—ArcPy Functions | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But you will only see the messages when you use "View Details" on the tool after it runs.&amp;nbsp; Messages don't display in a popup or anything like that&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2020 19:42:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-display-geocode-results-within-messages/m-p/754790#M58204</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-02-19T19:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I display geocode results within messages section of script results?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-display-geocode-results-within-messages/m-p/754791#M58205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Dan I understand that the AddMessage function will work, but I don't know the correct syntax to receive the results from arcpy.GeocodeAddresses_geocoding to get the information I'm looking for to display under "View Details". For each file being geocoded I would like the name of the ouput feature class and the number of unmatched records to be shown.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Feb 2020 20:41:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-display-geocode-results-within-messages/m-p/754791#M58205</guid>
      <dc:creator>KyleCrawford2</dc:creator>
      <dc:date>2020-02-20T20:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I display geocode results within messages section of script results?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-display-geocode-results-within-messages/m-p/754792#M58206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might want to consider adding the message at the completion of geocoding: make a feature layer of your geocoded results, select where status = 'U' and use &lt;A href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/get-count.htm"&gt;get count&lt;/A&gt; to see how many are unmatched; return that count in your message.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Feb 2020 20:46:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-display-geocode-results-within-messages/m-p/754792#M58206</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-02-20T20:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I display geocode results within messages section of script results?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-display-geocode-results-within-messages/m-p/754793#M58207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joe thank you for your suggestion. This is the code block that I came up with. Unfortunately, when I place it multiple times in the script to handle the number of inputs I get undesired results. I could probably set up a loop that runs through this code block, but my python skills are limited.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;whereClause &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Status = 'U'"&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;geocode_result1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"geocode_result1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; whereClause&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
result &lt;SPAN class="operator 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;&lt;SPAN class="string token"&gt;"geocode_result1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
count &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; int&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;result&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; count &lt;SPAN class="operator token"&gt;&amp;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="keyword token"&gt;try&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
      arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddMessage&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Weekly Crime: Unmatched:"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; count&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
   &lt;SPAN class="keyword token"&gt;except&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
      arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddMessage&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Weekly Crime: All Matched"&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;/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;Below is the common result I receive. The two issues are for one, not all the messages are displayed. The second issue is that the outputs are wrong, "Weekly Crime 4 Weeks" should return the unmatched response not an all matched response.&lt;/P&gt;&lt;P&gt;Messages:&lt;/P&gt;&lt;P&gt;Running script Geocoding Weekly Crimes...&lt;BR /&gt;Weekly Crime 4 Weeks: All Matched&lt;BR /&gt;Weekly Crime 4 Weeks Night: All Matched&lt;BR /&gt;Completed script Geocoding Weekly Crimes...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:01:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-display-geocode-results-within-messages/m-p/754793#M58207</guid>
      <dc:creator>KyleCrawford2</dc:creator>
      <dc:date>2021-12-12T08:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I display geocode results within messages section of script results?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-display-geocode-results-within-messages/m-p/754794#M58208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;line 4 is suspect:&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;count &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; int&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;result&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;

count &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; int&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;result&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="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;My line 3 just worked for me....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:01:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-display-geocode-results-within-messages/m-p/754794#M58208</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-12T08:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I display geocode results within messages section of script results?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-display-geocode-results-within-messages/m-p/754795#M58209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I figured out a few things that I was getting wrong but in the end, this is the simple code block:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;geocode_result1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"geocode_result_1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; whereClause&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
result &lt;SPAN class="operator 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;&lt;SPAN class="string token"&gt;"geocode_result_1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
count &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; int&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;result&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; count &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
   arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddMessage&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Weekly Crime - Unmatched: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;count&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&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;
   arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddMessage&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Weekly Crime: All Matched"&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;/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;This will allow the end-user to quickly see if they need to rematch any unmatched records.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:01:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-display-geocode-results-within-messages/m-p/754795#M58209</guid>
      <dc:creator>KyleCrawford2</dc:creator>
      <dc:date>2021-12-12T08:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I display geocode results within messages section of script results?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-display-geocode-results-within-messages/m-p/754796#M58210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a cooler way to format your message in line 5:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Addmessage&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;f&lt;SPAN class="string token"&gt;'Weekly Crime - Unmatched {count}'&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;&lt;/P&gt;&lt;P&gt;see:&amp;nbsp;&amp;nbsp;&lt;A class="link-titled" href="https://realpython.com/python-f-strings/" title="https://realpython.com/python-f-strings/"&gt;https://realpython.com/python-f-strings/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2020 21:54:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-display-geocode-results-within-messages/m-p/754796#M58210</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-02-24T21:54:04Z</dc:date>
    </item>
  </channel>
</rss>

