<?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: Using a Search Cursor to Update Map Text - Not getting all info in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-a-search-cursor-to-update-map-text-not/m-p/135946#M10681</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="keyword"&gt;Find the text element first, set it's value to nothing, then search and append the report values.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="keyword"&gt;for&lt;/SPAN&gt; elm &lt;SPAN class="keyword"&gt;in&lt;/SPAN&gt; arcpy.mapping.ListLayoutElements(mxd,&lt;SPAN class="string"&gt;"TEXT_ELEMENT"&lt;/SPAN&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="keyword"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if elm.name == &lt;SPAN class="string"&gt;"Report"&lt;/SPAN&gt;:&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="keyword"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elm.text = ""&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.SearchCursor(StopsTable, [&lt;SPAN class="string"&gt;"Stop_Number", &lt;SPAN class="string"&gt;"Stop_Status"&lt;/SPAN&gt;]) as cursor:&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="keyword"&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; for row &lt;SPAN class="keyword"&gt;in&lt;/SPAN&gt; cursor:&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="keyword"&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; elm.text = elm.text + &lt;SPAN class="string"&gt;"Stops "&lt;/SPAN&gt;+str(row[&lt;SPAN class="number"&gt;0&lt;/SPAN&gt;])+&lt;SPAN class="string"&gt;": "&lt;/SPAN&gt;+row[&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;] +&lt;SPAN class="string"&gt;"\n"&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Jan 2016 19:58:11 GMT</pubDate>
    <dc:creator>JimmyKroon</dc:creator>
    <dc:date>2016-01-20T19:58:11Z</dc:date>
    <item>
      <title>Using a Search Cursor to Update Map Text - Not getting all info</title>
      <link>https://community.esri.com/t5/python-questions/using-a-search-cursor-to-update-map-text-not/m-p/135939#M10674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've written a python script that reads data from a related table and writes those field values into a text box within ArcMap. The script runs OK when I tell it to print to the command window (all fields are printed), but in the map instead of entering to the new line of text, it appears to be writing over itself. How can I stop this a get it to write in all this info? &lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, os, traceback

mxd = arcpy.mapping.MapDocument(r"\\ad.utah.edu\sys\FM\gis\ags_directories\DDC_Web\Template.mxd")
&lt;SPAN&gt;StopsTable = r"\\csi-files\\fm\\gis\\ags_10_3\\ags_content\\sde_connection_files\\&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:fm-agsDataReader@fm-gisdbtest0.fm.utah.edu" rel="nofollow noopener noreferrer" target="_blank"&gt;fm-agsDataReader@fm-gisdbtest0.fm.utah.edu&lt;/A&gt;&lt;SPAN&gt;.sde\\UUSD.DBO.DDC\\UUSD.DBO.DDC_Stops"&lt;/SPAN&gt;

for elm in arcpy.mapping.ListLayoutElements(mxd,"TEXT_ELEMENT"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; sc = arcpy.SearchCursor(StopsTable)
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in sc:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if elm.name == "Report":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Stops "+str(row.Stop_Number)+": "+row.Stop_Status+"\n"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elm.text = "Stops "+str(row.Stop_Number)+": "+row.Stop_Status+"\n"&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Python Shell Print Screen (to show me the script is doing what I want it to)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/171266_pastedImage_3.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Final MXD after Script runs:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/171267_pastedImage_4.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:34:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-a-search-cursor-to-update-map-text-not/m-p/135939#M10674</guid>
      <dc:creator>RachelAlbritton</dc:creator>
      <dc:date>2021-12-11T07:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Search Cursor to Update Map Text - Not getting all info</title>
      <link>https://community.esri.com/t5/python-questions/using-a-search-cursor-to-update-map-text-not/m-p/135940#M10675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;Store the growing string in a variable, then write it to the element.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;Untested:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;my_string = ""&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; row &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; sc:&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; elm.name == &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"Report"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;:&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;print&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"Stops "&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;+str(row.Stop_Number)+&lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;": "&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;+row.Stop_Status+&lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"\n"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; my_string += &lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"Stops "&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;+str(row.Stop_Number)+&lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;": "&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;+row.Stop_Status+&lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;"\n"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="background-color: inherit; color: black; font-weight: inherit; font-size: 9pt !important; font-style: inherit;"&gt;elm.text = my_string&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:34:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-a-search-cursor-to-update-map-text-not/m-p/135940#M10675</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-11T07:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Search Cursor to Update Map Text - Not getting all info</title>
      <link>https://community.esri.com/t5/python-questions/using-a-search-cursor-to-update-map-text-not/m-p/135941#M10676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;great Idea, but I got the same results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've figured out that I can make each stop its own text box and that works - tedious though:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for elm in arcpy.mapping.ListLayoutElements(mxd,"TEXT_ELEMENT"):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sc = arcpy.SearchCursor(StopsTable)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in sc:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if elm.name == "Stop2" and row.Stop_Number == 2:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elm.text = "Stop "+str(row.Stop_Number)+": "+row.Stop_Status&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elif elm.name == "Stop3" and row.Stop_Number == 3:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elm.text = "Stop "+str(row.Stop_Number)+": "+row.Stop_Statusy_string = "" for row in sc:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if elm.name == "Report":&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; print "Stops "+str(row.Stop_Number)+": "+row.Stop_Status+"\n"&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; my_string += "Stops "+str(row.Stop_Number)+": "+row.Stop_Status+"\n" elm.text = my_strin&lt;/P&gt;&lt;DIV style="display: none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2016 19:06:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-a-search-cursor-to-update-map-text-not/m-p/135941#M10676</guid>
      <dc:creator>RachelAlbritton</dc:creator>
      <dc:date>2016-01-20T19:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Search Cursor to Update Map Text - Not getting all info</title>
      <link>https://community.esri.com/t5/python-questions/using-a-search-cursor-to-update-map-text-not/m-p/135942#M10677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rachel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each time you iterate through the table you are overwriting the text element.&amp;nbsp; So the last row is always displayed.&amp;nbsp; You will need to append the element's text each time.&amp;nbsp; Ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for elm in arcpy.mapping.ListLayoutElements(mxd,"TEXT_ELEMENT"): 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.SearchCursor(StopsTable, ["Stop_Number", "Stop_Status"]) as cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&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; if elm.name == "Report": 
&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; elm.text = elm.text + "Stops "+str(row[0])+": "+row[1] +"\n"&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note:&amp;nbsp; I used the arcpy.da.SearchCursor in the above example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:34:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-a-search-cursor-to-update-map-text-not/m-p/135942#M10677</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T07:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Search Cursor to Update Map Text - Not getting all info</title>
      <link>https://community.esri.com/t5/python-questions/using-a-search-cursor-to-update-map-text-not/m-p/135943#M10678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is that line 12 overwrites elm.text during each cycle of the loop. You need to append the new text to the previous values without overwriting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would have thought changing = to += would work, but if not, try the append() string function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mystring.append(&lt;EM&gt;new text to add&lt;/EM&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2016 19:23:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-a-search-cursor-to-update-map-text-not/m-p/135943#M10678</guid>
      <dc:creator>JimmyKroon</dc:creator>
      <dc:date>2016-01-20T19:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Search Cursor to Update Map Text - Not getting all info</title>
      <link>https://community.esri.com/t5/python-questions/using-a-search-cursor-to-update-map-text-not/m-p/135944#M10679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jake - That's what I needed. So my only issue is now, this will always add to whatever existing text is already in the text box. Each time I run the script I need the existing info to be deleted and the new info written in. Any suggestions? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2016 19:25:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-a-search-cursor-to-update-map-text-not/m-p/135944#M10679</guid>
      <dc:creator>RachelAlbritton</dc:creator>
      <dc:date>2016-01-20T19:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Search Cursor to Update Map Text - Not getting all info</title>
      <link>https://community.esri.com/t5/python-questions/using-a-search-cursor-to-update-map-text-not/m-p/135945#M10680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could do something along the following:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;firstTime = True

with arcpy.da.SearchCursor(StopsTable, ["Stop_Number", "Stop_Status"]) as cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for elm in arcpy.mapping.ListLayoutElements(mxd,"TEXT_ELEMENT"):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if elm.name == "Report":
&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; if firstTime:
&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; elm.text = "Stops "+str(row[0])+": "+row[1] +"\n"
&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; firstTime = False
&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; else:&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;&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;&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; elm.text = elm.text + "Stops "+str(row[0])+": "+row[1] +"\n"

arcpy.RefreshActiveView()&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:34:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-a-search-cursor-to-update-map-text-not/m-p/135945#M10680</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T07:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Search Cursor to Update Map Text - Not getting all info</title>
      <link>https://community.esri.com/t5/python-questions/using-a-search-cursor-to-update-map-text-not/m-p/135946#M10681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="keyword"&gt;Find the text element first, set it's value to nothing, then search and append the report values.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="keyword"&gt;for&lt;/SPAN&gt; elm &lt;SPAN class="keyword"&gt;in&lt;/SPAN&gt; arcpy.mapping.ListLayoutElements(mxd,&lt;SPAN class="string"&gt;"TEXT_ELEMENT"&lt;/SPAN&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="keyword"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if elm.name == &lt;SPAN class="string"&gt;"Report"&lt;/SPAN&gt;:&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="keyword"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elm.text = ""&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.SearchCursor(StopsTable, [&lt;SPAN class="string"&gt;"Stop_Number", &lt;SPAN class="string"&gt;"Stop_Status"&lt;/SPAN&gt;]) as cursor:&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="keyword"&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; for row &lt;SPAN class="keyword"&gt;in&lt;/SPAN&gt; cursor:&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="keyword"&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; elm.text = elm.text + &lt;SPAN class="string"&gt;"Stops "&lt;/SPAN&gt;+str(row[&lt;SPAN class="number"&gt;0&lt;/SPAN&gt;])+&lt;SPAN class="string"&gt;": "&lt;/SPAN&gt;+row[&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;] +&lt;SPAN class="string"&gt;"\n"&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2016 19:58:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-a-search-cursor-to-update-map-text-not/m-p/135946#M10681</guid>
      <dc:creator>JimmyKroon</dc:creator>
      <dc:date>2016-01-20T19:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Search Cursor to Update Map Text - Not getting all info</title>
      <link>https://community.esri.com/t5/python-questions/using-a-search-cursor-to-update-map-text-not/m-p/135947#M10682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, I thought that would work as well, but unfortunately it doesn't...not sure why&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I decided to clone the text box, and write the report to the clone. Then the clone can be deleted at the beginning of the script when it ran and a new clone will be created to write to.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2016 20:12:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-a-search-cursor-to-update-map-text-not/m-p/135947#M10682</guid>
      <dc:creator>RachelAlbritton</dc:creator>
      <dc:date>2016-01-20T20:12:41Z</dc:date>
    </item>
  </channel>
</rss>

