<?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: arcade if, else (do nothing) in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-else-do-nothing/m-p/207437#M9141</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can simply add the line "return $feature.verharding" to the else clause, which means for all other values it will just return the existing value.&lt;/P&gt;&lt;P&gt;Note,&amp;nbsp;a better way to do this would be to use the IIF arcade function detailed here:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/arcade/function-reference/logical_functions/" title="https://developers.arcgis.com/arcade/function-reference/logical_functions/"&gt;Logical Functions | ArcGIS for Developers&lt;/A&gt;&amp;nbsp; to do it in one line!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jul 2020 08:24:40 GMT</pubDate>
    <dc:creator>JoshuaSharp-Heward</dc:creator>
    <dc:date>2020-07-28T08:24:40Z</dc:date>
    <item>
      <title>arcade if, else (do nothing)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-else-do-nothing/m-p/207436#M9140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm filling in some missing attributes in a feature layer using 'calculate field' and I&amp;nbsp;tried:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/501489_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;and this works, kind of. Empty fields gets filled in with '3' but any field already filled are emptied and &amp;lt;null&amp;gt; afterwards.&lt;/P&gt;&lt;P&gt;So for the moment I have:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/501490_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;which covers all possible values (in the coded value domain on this attribute). This works but is cumbersome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I would like to do is something like&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/501491_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;P&gt;How can I achieve this ... &lt;SPAN style="text-decoration: underline;"&gt;else do nothing&lt;/SPAN&gt; ... ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for your time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bert Kraan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2020 07:48:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-else-do-nothing/m-p/207436#M9140</guid>
      <dc:creator>Gisbert61</dc:creator>
      <dc:date>2020-07-28T07:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: arcade if, else (do nothing)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-else-do-nothing/m-p/207437#M9141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can simply add the line "return $feature.verharding" to the else clause, which means for all other values it will just return the existing value.&lt;/P&gt;&lt;P&gt;Note,&amp;nbsp;a better way to do this would be to use the IIF arcade function detailed here:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/arcade/function-reference/logical_functions/" title="https://developers.arcgis.com/arcade/function-reference/logical_functions/"&gt;Logical Functions | ArcGIS for Developers&lt;/A&gt;&amp;nbsp; to do it in one line!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2020 08:24:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-else-do-nothing/m-p/207437#M9141</guid>
      <dc:creator>JoshuaSharp-Heward</dc:creator>
      <dc:date>2020-07-28T08:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: arcade if, else (do nothing)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-else-do-nothing/m-p/207438#M9142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Bert&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Guess the easiest will be to select all null values using Select by attributes, and then run the calculation using your initial code on the selected set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively,&amp;nbsp;you may send the value to the field calculator using:&lt;BR /&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/501497_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2020 08:26:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-else-do-nothing/m-p/207438#M9142</guid>
      <dc:creator>HåkonDreyer</dc:creator>
      <dc:date>2020-07-28T08:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: arcade if, else (do nothing)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-else-do-nothing/m-p/207439#M9143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/33297" target="_blank"&gt;Bert Kraan&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was actually going to come up with the first solution given by &lt;A href="https://community.esri.com/migrated-users/264110" target="_blank"&gt;Joshua Sharp-Heward&lt;/A&gt;, but from the same answer I learned about the &lt;SPAN style="font-family: andale mono, monospace;"&gt;IIf()&lt;/SPAN&gt; function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's why it is so good to follow this forum, to learn a little every day (very kaizen!).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, to wrap up:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6;" width="100%"&gt;&lt;THEAD&gt;&lt;TR style="background-color: #efefef;"&gt;&lt;TH style="width: 46.6166%;"&gt;Simple solution&lt;/TH&gt;&lt;TH style="width: 49.3834%;"&gt;One line solution&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="width: 46.6166%;"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;IsEmpty&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;verharding&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="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&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;else&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; $feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;verharding&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/TD&gt;&lt;TD style="width: 49.3834%;"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;IIf &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;IsEmpty&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;verharding&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; $feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;verharding&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;/CODE&gt;&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Egge-Jan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:15:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-else-do-nothing/m-p/207439#M9143</guid>
      <dc:creator>Egge-Jan_Pollé</dc:creator>
      <dc:date>2021-12-11T10:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: arcade if, else (do nothing)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-else-do-nothing/m-p/207440#M9144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Thanks all&lt;/STRONG&gt; for three great answers from all over the globe!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2020 10:00:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-else-do-nothing/m-p/207440#M9144</guid>
      <dc:creator>Gisbert61</dc:creator>
      <dc:date>2020-07-28T10:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: arcade if, else (do nothing)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-else-do-nothing/m-p/1332018#M73396</link>
      <description>&lt;P&gt;This is a good solution, but it does change the edit date on the records as if they were actually calculated. I wonder if there is another way to do this (when selecting a set first is not an option)?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 15:14:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-else-do-nothing/m-p/1332018#M73396</guid>
      <dc:creator>JJ_Reyes</dc:creator>
      <dc:date>2023-09-25T15:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: arcade if, else (do nothing)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-else-do-nothing/m-p/1544702#M88774</link>
      <description>&lt;P&gt;Long out of date, but thanks to you and&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/223231"&gt;@JoshuaSharp-Heward&lt;/a&gt;&amp;nbsp;for mentioning IIF statements. I was able to greatly streamline some of my attribute rules using this newfound knowledge!&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 12:44:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-else-do-nothing/m-p/1544702#M88774</guid>
      <dc:creator>MDB_GIS</dc:creator>
      <dc:date>2024-10-02T12:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: arcade if, else (do nothing)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-else-do-nothing/m-p/1544772#M88782</link>
      <description>&lt;P&gt;I am pretty sure you are out of luck, and it isn't just an Arcade limitation.&amp;nbsp; Calculate Field has to return something for each record, there is no way to tell Calculate Field to stop processing the current record and move onto the next.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 14:30:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-else-do-nothing/m-p/1544772#M88782</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2024-10-02T14:30:15Z</dc:date>
    </item>
  </channel>
</rss>

