<?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: Calculate Field (Multiple) tool not working when using two different expressions in the code block in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/calculate-field-multiple-tool-not-working-when/m-p/833975#M713</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;no problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Jul 2020 08:37:44 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2020-07-22T08:37:44Z</dc:date>
    <item>
      <title>Calculate Field (Multiple) tool not working when using two different expressions in the code block</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/calculate-field-multiple-tool-not-working-when/m-p/833972#M710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Looking for help using the Calculate Fields (Multiple) tool. Individually I am able to calculate my two fields successfully. However, when I use the multiple tool, and put both expressions into the code block, it skips the first def Reclass and only carries out the second? I feel like this should be easy to resolve, but cannot work out what i am doing wrong!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached a screen grab of the tool dialogue box and have included the code block below.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def Reclass(Surface):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if Surface is None:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; elif Surface == "Well Drained":&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0.5&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; elif Surface == "Boggy":&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; elif Surface == "Standing Water":&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 1.5&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; elif Surface == "Blocked Drainage":&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 3&amp;nbsp;&amp;nbsp;&lt;BR /&gt;def Reclass(Evidence_of_Instability):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if Evidence_of_Instability is "None":&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; elif Evidence_of_Instability == "Surface Erosion":&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 1.4&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; elif Evidence_of_Instability == "Localised Evidence":&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 1.7&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; elif Evidence_of_Instability == "Extensive Evidence":&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 2&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2020 17:38:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/calculate-field-multiple-tool-not-working-when/m-p/833972#M710</guid>
      <dc:creator>JenniferLawrie</dc:creator>
      <dc:date>2020-07-21T17:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field (Multiple) tool not working when using two different expressions in the code block</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/calculate-field-multiple-tool-not-working-when/m-p/833973#M711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try renaming one of the def's to Reclass2.&amp;nbsp; I suspect the duplicate function name is why you are getting only the last one&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2020 19:33:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/calculate-field-multiple-tool-not-working-when/m-p/833973#M711</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-07-21T19:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field (Multiple) tool not working when using two different expressions in the code block</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/calculate-field-multiple-tool-not-working-when/m-p/833974#M712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for this, it has worked &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt; Still fairly new to model builder/python and assumed that because each Reclass function was followed by a different field, it would carry out both. This does make sense though, so thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2020 08:14:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/calculate-field-multiple-tool-not-working-when/m-p/833974#M712</guid>
      <dc:creator>JenniferLawrie</dc:creator>
      <dc:date>2020-07-22T08:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field (Multiple) tool not working when using two different expressions in the code block</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/calculate-field-multiple-tool-not-working-when/m-p/833975#M713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;no problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2020 08:37:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/calculate-field-multiple-tool-not-working-when/m-p/833975#M713</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-07-22T08:37:44Z</dc:date>
    </item>
  </channel>
</rss>

