<?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 How to change the dynamic text tag for maximum value in a field using Arcpy.mp? in Python Snippets Questions</title>
    <link>https://community.esri.com/t5/python-snippets-questions/how-to-change-the-dynamic-text-tag-for-maximum/m-p/838208#M461</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone: I have successfully produced a map with title, legend and statistics (number, maximum, minimum, mean). I did this within ArcPro through the desktop application, creating a template. Now I want to produce many maps, but only changing the column of data or "field" in the corresponding attribute table. I only having issues with the statistics (number, maximum, minimum, mean) where the field does not change even when the map plots do (so I have the title, legend and the map colors for each polygon on the map updating to the newer column through an earlier command "sym.renderer.classificationField = 'Sheet4.NEI2014v_1'&amp;nbsp; "&amp;nbsp; which switched it from the NEI2014v2_ field. This command appears to not impact the text statistics (number, max, min, mean) which are based on the listElements module under "TEXT_ELEMENT".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The dynamic text tag reads as follows:&amp;nbsp;Maximum: &amp;lt;dyn type="table" property="max" mapFrame="Map Frame" mapMemberUri="CIMPATH=map/cb_2018_us_county_500k.xml" isDynamic="true" field="Sheet4.NEI2014v2_" decimalPlaces="2" separator="true"/&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Arcpy.mp, I am able to print out this text out with:&lt;/P&gt;&lt;P&gt;aprx = arcpy.mp.ArcGISProject(relpath + r'C:/Users/ggrodzinsky/Documents/ArcGIS/Projects/MyProject8/SavedOutput7014.aprx') &lt;BR /&gt;m=aprx.listMaps("Map")[0] &lt;BR /&gt;l = m.listLayers()[2]&lt;BR /&gt;Layout = aprx.listLayouts("Layout")[0]&lt;/P&gt;&lt;P&gt;five=Layout.listElements("TEXT_ELEMENT",'Text 2')[0]&lt;/P&gt;&lt;P&gt;print(five.text)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And it produced:&lt;BR /&gt;Maximum: &amp;lt;dyn type="table" property="max" mapFrame="Map Frame" mapMemberUri="CIMPATH=map/cb_2018_us_county_500k.xml" isDynamic="true" field="Sheet4.NEI2014v2_" decimalPlaces="2" separator="true"/&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't worry about the above coding, other than this is how I confirmed this is indeed the contents of this Text Element on the Layout I am working on.&amp;nbsp; What I want to do in my program is change the dynamic text tag so the field&amp;nbsp;changes to a different column of values in the attribute table ("field" is the column title on the attribute table), specifically from "Sheet4.NEI2014v2_" to "Sheet4.NEI2014v_1".&amp;nbsp; So if I typed "print(five.text) again, it would show field="Sheet.NEI2014v_1" instead in the dynamic text tag.&lt;/P&gt;&lt;P&gt;I searched around and can't find the correct command or coding to have the dynamic text tag change the "field"&lt;/P&gt;&lt;P&gt;It is simply typing in a box in the ArcPro desktop app, but I want to mass produce this through Arcpy.mp (or at least be able to produce a dozen at a time for this case).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for your input!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Oct 2020 18:35:48 GMT</pubDate>
    <dc:creator>GilGrodzinsky</dc:creator>
    <dc:date>2020-10-16T18:35:48Z</dc:date>
    <item>
      <title>How to change the dynamic text tag for maximum value in a field using Arcpy.mp?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/how-to-change-the-dynamic-text-tag-for-maximum/m-p/838208#M461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone: I have successfully produced a map with title, legend and statistics (number, maximum, minimum, mean). I did this within ArcPro through the desktop application, creating a template. Now I want to produce many maps, but only changing the column of data or "field" in the corresponding attribute table. I only having issues with the statistics (number, maximum, minimum, mean) where the field does not change even when the map plots do (so I have the title, legend and the map colors for each polygon on the map updating to the newer column through an earlier command "sym.renderer.classificationField = 'Sheet4.NEI2014v_1'&amp;nbsp; "&amp;nbsp; which switched it from the NEI2014v2_ field. This command appears to not impact the text statistics (number, max, min, mean) which are based on the listElements module under "TEXT_ELEMENT".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The dynamic text tag reads as follows:&amp;nbsp;Maximum: &amp;lt;dyn type="table" property="max" mapFrame="Map Frame" mapMemberUri="CIMPATH=map/cb_2018_us_county_500k.xml" isDynamic="true" field="Sheet4.NEI2014v2_" decimalPlaces="2" separator="true"/&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Arcpy.mp, I am able to print out this text out with:&lt;/P&gt;&lt;P&gt;aprx = arcpy.mp.ArcGISProject(relpath + r'C:/Users/ggrodzinsky/Documents/ArcGIS/Projects/MyProject8/SavedOutput7014.aprx') &lt;BR /&gt;m=aprx.listMaps("Map")[0] &lt;BR /&gt;l = m.listLayers()[2]&lt;BR /&gt;Layout = aprx.listLayouts("Layout")[0]&lt;/P&gt;&lt;P&gt;five=Layout.listElements("TEXT_ELEMENT",'Text 2')[0]&lt;/P&gt;&lt;P&gt;print(five.text)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And it produced:&lt;BR /&gt;Maximum: &amp;lt;dyn type="table" property="max" mapFrame="Map Frame" mapMemberUri="CIMPATH=map/cb_2018_us_county_500k.xml" isDynamic="true" field="Sheet4.NEI2014v2_" decimalPlaces="2" separator="true"/&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't worry about the above coding, other than this is how I confirmed this is indeed the contents of this Text Element on the Layout I am working on.&amp;nbsp; What I want to do in my program is change the dynamic text tag so the field&amp;nbsp;changes to a different column of values in the attribute table ("field" is the column title on the attribute table), specifically from "Sheet4.NEI2014v2_" to "Sheet4.NEI2014v_1".&amp;nbsp; So if I typed "print(five.text) again, it would show field="Sheet.NEI2014v_1" instead in the dynamic text tag.&lt;/P&gt;&lt;P&gt;I searched around and can't find the correct command or coding to have the dynamic text tag change the "field"&lt;/P&gt;&lt;P&gt;It is simply typing in a box in the ArcPro desktop app, but I want to mass produce this through Arcpy.mp (or at least be able to produce a dozen at a time for this case).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for your input!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2020 18:35:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/how-to-change-the-dynamic-text-tag-for-maximum/m-p/838208#M461</guid>
      <dc:creator>GilGrodzinsky</dc:creator>
      <dc:date>2020-10-16T18:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the dynamic text tag for maximum value in a field using Arcpy.mp?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/how-to-change-the-dynamic-text-tag-for-maximum/m-p/838209#M462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A _jive_internal="true" data-userid="416893" data-username="Gil.Grodzinsky_GAEPD" href="https://community.esri.com/people/Gil.Grodzinsky_GAEPD"&gt;Gil Grodzinsky&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The text property is a string that is returned, hence you can use the Python string replace function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;five.text = five&lt;/SPAN&gt;.text.replace("&lt;SPAN style="background-color: #ffffff;"&gt;Sheet4.NEI2014v2_&lt;/SPAN&gt;","&lt;SPAN&gt;Sheet4.NEI2014v_1&lt;/SPAN&gt;")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;print(five.text)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Maximum: &amp;lt;dyn type="table" property="max" mapFrame="Map Frame" mapMemberUri="CIMPATH=map/cb_2018_us_county_500k.xml" isDynamic="true" field="&lt;SPAN&gt;Sheet4.NEI2014v_1&lt;/SPAN&gt;" decimalPlaces="2" separator="true"/&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Hope this helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="direction: ltr; border-width: 100%;"&gt;&lt;DIV style="direction: ltr; margin-top: 0in; margin-left: 0in; width: 7.5in;"&gt;&lt;DIV style="direction: ltr; margin-top: 0in; margin-left: 0in; width: 7.5in;"&gt;&lt;P style="margin: 0in; font-family: arial; font-size: 11.25pt; color: #3d3d3d;"&gt;&lt;SPAN style="background: white;"&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: arial; font-size: 11.25pt; color: #3d3d3d;"&gt;&lt;SPAN style="background: white;"&gt;Manish&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-family: inherit; font-size: 9.75pt; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: italic; background: white;"&gt;If this answer solved your question or if you found it helpful please mark it accordingly to help others who have the same question.&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Oct 2020 03:53:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/how-to-change-the-dynamic-text-tag-for-maximum/m-p/838209#M462</guid>
      <dc:creator>ManishPatel</dc:creator>
      <dc:date>2020-10-17T03:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the dynamic text tag for maximum value in a field using Arcpy.mp?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/how-to-change-the-dynamic-text-tag-for-maximum/m-p/838210#M463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Manish, you are a godsend. It worked like a charm. Thanks so much!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Oct 2020 03:48:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/how-to-change-the-dynamic-text-tag-for-maximum/m-p/838210#M463</guid>
      <dc:creator>GilGrodzinsky</dc:creator>
      <dc:date>2020-10-18T03:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the dynamic text tag for maximum value in a field using Arcpy.mp?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/how-to-change-the-dynamic-text-tag-for-maximum/m-p/838211#M464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A _jive_internal="true" class="" data-userid="416893" data-username="Gil.Grodzinsky_GAEPD" href="https://community.esri.com/people/Gil.Grodzinsky_GAEPD"&gt;Gil Grodzinsky&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Happy to help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Glad that it worked, also please dont forget to mark the reply as answered, this will help other users to find it quickly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a good day ahead!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Manish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Oct 2020 07:21:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/how-to-change-the-dynamic-text-tag-for-maximum/m-p/838211#M464</guid>
      <dc:creator>ManishPatel</dc:creator>
      <dc:date>2020-10-18T07:21:52Z</dc:date>
    </item>
  </channel>
</rss>

