<?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: model builder tool to replace values of an attribute in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/model-builder-tool-to-replace-values-of-an/m-p/1071884#M42414</link>
    <description>&lt;P&gt;That would be in fact helpful if you would share your solution here.&lt;/P&gt;&lt;P&gt;And then except it as solution so the post is marked as solved.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Jun 2021 07:52:37 GMT</pubDate>
    <dc:creator>Nicole_Ueberschär</dc:creator>
    <dc:date>2021-06-24T07:52:37Z</dc:date>
    <item>
      <title>model builder tool to replace values of an attribute</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/model-builder-tool-to-replace-values-of-an/m-p/1071840#M42403</link>
      <description>&lt;P&gt;hello everyone,&lt;BR /&gt;i am using arcgis pro 2.4. I am trying to change the values of an attribute suing model builder calculate fiend tool. however, I am getting an error when I run the tool. Below is a screen shot of what i am using and getting error 000539. Any thoughts or suggestions on how i can overcome this would be highly appreciated.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="fred_bastian_0-1624507048502.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/16779i8723C33BE9F73FAC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="fred_bastian_0-1624507048502.png" alt="fred_bastian_0-1624507048502.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 03:58:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/model-builder-tool-to-replace-values-of-an/m-p/1071840#M42403</guid>
      <dc:creator>fred_bastian</dc:creator>
      <dc:date>2021-06-24T03:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: model builder tool to replace values of an attribute</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/model-builder-tool-to-replace-values-of-an/m-p/1071854#M42406</link>
      <description>&lt;P&gt;Screenshot of full error message?&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 04:52:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/model-builder-tool-to-replace-values-of-an/m-p/1071854#M42406</guid>
      <dc:creator>Waffle_House</dc:creator>
      <dc:date>2021-06-24T04:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: model builder tool to replace values of an attribute</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/model-builder-tool-to-replace-values-of-an/m-p/1071858#M42407</link>
      <description>&lt;P&gt;what you did is wrong. you have to write the in a function in Code Block section, then call it .&lt;BR /&gt;try this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Fire_Risk_T=
replace_func(!Fire_Risk_T!,"1","HBLCA")

=====Code Block====
def replace_func(field, old_text,new_text):
    return field.replace(old_text,new_text)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 05:09:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/model-builder-tool-to-replace-values-of-an/m-p/1071858#M42407</guid>
      <dc:creator>NABAZGHARIBMOHAMMED</dc:creator>
      <dc:date>2021-06-24T05:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: model builder tool to replace values of an attribute</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/model-builder-tool-to-replace-values-of-an/m-p/1071859#M42408</link>
      <description>&lt;P&gt;Documentation for Calculate Value tool in ModelBuilder:&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/modelbuilder-toolbox/calculate-value.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/tool-reference/modelbuilder-toolbox/calculate-value.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 05:26:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/model-builder-tool-to-replace-values-of-an/m-p/1071859#M42408</guid>
      <dc:creator>Waffle_House</dc:creator>
      <dc:date>2021-06-24T05:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: model builder tool to replace values of an attribute</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/model-builder-tool-to-replace-values-of-an/m-p/1071863#M42410</link>
      <description>&lt;P&gt;I assume !Fire_Risk_T! field has a &lt;STRONG&gt;Text&lt;/STRONG&gt; datatype. If not, please create a new field with Text DataType and use Field Calculator on that field.&lt;/P&gt;&lt;P&gt;Check the following expression&lt;/P&gt;&lt;LI-CODE lang="python"&gt;!Fire_Risk_T!.replace("1","HBLCA")&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 24 Jun 2021 05:46:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/model-builder-tool-to-replace-values-of-an/m-p/1071863#M42410</guid>
      <dc:creator>JayantaPoddar</dc:creator>
      <dc:date>2021-06-24T05:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: model builder tool to replace values of an attribute</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/model-builder-tool-to-replace-values-of-an/m-p/1071867#M42411</link>
      <description>&lt;P&gt;hey thanks for your help.&lt;BR /&gt;I had done that already. In fact, I already finished creating the model and it works nicely!&lt;BR /&gt;Maybe I should document it here how I did it in case others come across the same problem.&lt;BR /&gt;thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 06:05:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/model-builder-tool-to-replace-values-of-an/m-p/1071867#M42411</guid>
      <dc:creator>fred_bastian</dc:creator>
      <dc:date>2021-06-24T06:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: model builder tool to replace values of an attribute</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/model-builder-tool-to-replace-values-of-an/m-p/1071884#M42414</link>
      <description>&lt;P&gt;That would be in fact helpful if you would share your solution here.&lt;/P&gt;&lt;P&gt;And then except it as solution so the post is marked as solved.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 07:52:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/model-builder-tool-to-replace-values-of-an/m-p/1071884#M42414</guid>
      <dc:creator>Nicole_Ueberschär</dc:creator>
      <dc:date>2021-06-24T07:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: model builder tool to replace values of an attribute</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/model-builder-tool-to-replace-values-of-an/m-p/1072458#M42498</link>
      <description>&lt;P&gt;Hi Nicole,&lt;BR /&gt;I will reply with the solution detailed. Sorry, I had one of those moments when you lose it all and had to start from scratch again. Lucky I have a good memory and could put it together again. Stay tuned.&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 06:50:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/model-builder-tool-to-replace-values-of-an/m-p/1072458#M42498</guid>
      <dc:creator>fred_bastian</dc:creator>
      <dc:date>2021-06-25T06:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: model builder tool to replace values of an attribute</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/model-builder-tool-to-replace-values-of-an/m-p/1073044#M42566</link>
      <description>&lt;P&gt;This is the solution I worked out:&lt;/P&gt;&lt;P&gt;I ran the spatial joins and plain joins before manipulating the data. One thing to consider is the data type of the attribute to have its values replaced and the data type of the attribute to have its values compared to the first one. In this case the attribute to have the values changed is numeric and the other to be compared against is text. To be able to compare the 2 attributes they need to be of the same data type. So a new attribute has to be created with a text data type. Next the values from the original attribute are copied into the newly created attribute. Finally, the values can be replaced as required.&amp;nbsp; See below for screen shots.&lt;/P&gt;&lt;P&gt;1 - From the geoprocessing pane drag the "Add Field" tool from the data management tools.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="fred_bastian_1-1624836549792.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/17114i2104D1B0DD2E3822/image-size/medium?v=v2&amp;amp;px=400" role="button" title="fred_bastian_1-1624836549792.png" alt="fred_bastian_1-1624836549792.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="fred_bastian_3-1624836603173.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/17116i2DEFBBD760364E1C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="fred_bastian_3-1624836603173.png" alt="fred_bastian_3-1624836603173.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2 - Once the new filed is created, drag a "Calculate Field"&amp;nbsp;tool from the data management tools. Use expression type Arcade and then insert the attribute you want to copy values from right at the bottom by double clicking it in the "fields" list.&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="fred_bastian_4-1624836739765.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/17117i4DAACC073C4F7B0F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="fred_bastian_4-1624836739765.png" alt="fred_bastian_4-1624836739765.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="fred_bastian_5-1624836810417.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/17118i92A0E352A771C9D1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="fred_bastian_5-1624836810417.png" alt="fred_bastian_5-1624836810417.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;3 - Now that the values have been copied into the newly created attribute, drag another&amp;nbsp;"Calculate Field"&amp;nbsp;tool from the data management tools. This one will do the replacement of the values in the newly created attribute. By using the Arcade code expression right at the bottom. This uses the creation of a variable and a conditional "if" statement to find and replace values accordingly. PS - I had no null values in my data but if you do then you will need to adjust the statement to cater for nulls.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="fred_bastian_6-1624836966775.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/17119iC8EE469DC90B2D3F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="fred_bastian_6-1624836966775.png" alt="fred_bastian_6-1624836966775.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="fred_bastian_7-1624837141311.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/17120i1659F3A4D81212A5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="fred_bastian_7-1624837141311.png" alt="fred_bastian_7-1624837141311.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;4 - Now that the data is comparable, drag a "Select" from the Analysis tools. Fill in the SQL expression and away you go...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="fred_bastian_8-1624837357507.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/17121iF71FFB53BABD4A18/image-size/medium?v=v2&amp;amp;px=400" role="button" title="fred_bastian_8-1624837357507.png" alt="fred_bastian_8-1624837357507.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="fred_bastian_9-1624837385789.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/17122iC822DC819A4F534E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="fred_bastian_9-1624837385789.png" alt="fred_bastian_9-1624837385789.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you to all who took the time to read and attempted to help.&lt;BR /&gt;Cheers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Jun 2021 23:49:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/model-builder-tool-to-replace-values-of-an/m-p/1073044#M42566</guid>
      <dc:creator>fred_bastian</dc:creator>
      <dc:date>2021-06-27T23:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: model builder tool to replace values of an attribute</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/model-builder-tool-to-replace-values-of-an/m-p/1073129#M42575</link>
      <description>&lt;P&gt;Thanks for taking the time to document your solution!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 10:55:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/model-builder-tool-to-replace-values-of-an/m-p/1073129#M42575</guid>
      <dc:creator>Nicole_Ueberschär</dc:creator>
      <dc:date>2021-06-28T10:55:40Z</dc:date>
    </item>
  </channel>
</rss>

