<?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: Update information based upon variable in another field (Arcade) in ArcGIS Field Maps Questions</title>
    <link>https://community.esri.com/t5/arcgis-field-maps-questions/update-information-based-upon-variable-in-another/m-p/1405299#M8277</link>
    <description>&lt;P&gt;If this is your full code, then you don't need to declare the variables breed_status and originalStatus. The code in my reply utilizes an &lt;A href="https://developers.arcgis.com/arcade/guide/return/#implicit-returns" target="_self"&gt;implicit return&lt;/A&gt;, since it's a &lt;A href="https://developers.arcgis.com/arcade/guide/statements/#single-line-expressions" target="_self"&gt;single-line expression&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Wed, 03 Apr 2024 16:21:49 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2024-04-03T16:21:49Z</dc:date>
    <item>
      <title>Update information based upon variable in another field (Arcade)</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/update-information-based-upon-variable-in-another/m-p/1405097#M8268</link>
      <description>&lt;P&gt;When we are surveying birds across the moorland we need for the steps to be few and trying to create less steps for the surveyors.&amp;nbsp; This means that we need for records to be updated automatically.&lt;/P&gt;&lt;P&gt;If a record contains one thing then it will auto populate another field.&lt;/P&gt;&lt;P&gt;We will be using calculated field and Arcade for the production of this.&amp;nbsp; Just need some guidance as to what text to put in.&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;Not sure if which&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Profile variables or functions to use.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/arcgis-arcade-123-release/" target="_blank" rel="noopener"&gt;Introducing new Arcade functions and an enhanced playground (esri.com)&lt;/A&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://www.esri.com/arcgis-blog/products/field-maps/field-mobility/common-calculated-expressions-for-arcgis-field-maps/" target="_blank" rel="noopener"&gt;Common calculated expressions for ArcGIS Field Maps (esri.com)&lt;/A&gt;&lt;BR /&gt;None of the above seems to give me any pointers.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Appreciate a little help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Many thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 10:18:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/update-information-based-upon-variable-in-another/m-p/1405097#M8268</guid>
      <dc:creator>MattSully</dc:creator>
      <dc:date>2024-04-03T10:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: Update information based upon variable in another field (Arcade)</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/update-information-based-upon-variable-in-another/m-p/1405102#M8269</link>
      <description>&lt;P&gt;I have used this code, in Arcade.&lt;/P&gt;&lt;P&gt;// Declare breed_status variable&lt;BR /&gt;var breed_status;&lt;/P&gt;&lt;P&gt;// Get the value from the original field&lt;BR /&gt;var originalValue = $feature.Doing;&lt;/P&gt;&lt;P&gt;// Determine breeding status based on original field value&lt;BR /&gt;switch (originalValue) {&lt;BR /&gt;case 'Singing':&lt;BR /&gt;breed_status = 'Possible Breeder';&lt;BR /&gt;break;&lt;BR /&gt;case 'Pair in suitable nesting habitat':&lt;BR /&gt;case 'Observed in suitable nesting habitats':&lt;BR /&gt;case 'Agitated behaviour':&lt;BR /&gt;case 'Holding permanent territory':&lt;BR /&gt;case 'Nest building or excavating':&lt;BR /&gt;case 'Visiting nest site':&lt;BR /&gt;breed_status = 'Probable Breeder';&lt;BR /&gt;break;&lt;BR /&gt;case 'Recently fledged young, or downy young':&lt;BR /&gt;case 'Family party':&lt;BR /&gt;case 'Adults carrying faecal sac or food for young':&lt;BR /&gt;case 'Nest containing eggs':&lt;BR /&gt;case 'Nest with young seen or heard':&lt;BR /&gt;breed_status = 'Confirmed Breeder';&lt;BR /&gt;break;&lt;BR /&gt;case 'Flying over':&lt;BR /&gt;breed_status = 'Non Breeding';&lt;BR /&gt;break;&lt;BR /&gt;default:&lt;BR /&gt;breed_status = 'Unknown';&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// Return the determined breed_status&lt;BR /&gt;return breed_status;&lt;/P&gt;&lt;P&gt;The error thrown is this:&amp;nbsp;&lt;SPAN&gt;Test execution error: &lt;STRONG&gt;Unexpected token '{'.. Verify test data.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;Not sure what this means....&lt;BR /&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 11:35:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/update-information-based-upon-variable-in-another/m-p/1405102#M8269</guid>
      <dc:creator>MattSully</dc:creator>
      <dc:date>2024-04-03T11:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Update information based upon variable in another field (Arcade)</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/update-information-based-upon-variable-in-another/m-p/1405146#M8270</link>
      <description>&lt;P&gt;Arcade uses the &lt;A href="https://developers.arcgis.com/arcade/function-reference/logical_functions/#decode" target="_self"&gt;Decode&lt;/A&gt; function instead of switch/case.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Decode($feature.Doing,
       'Singing', 'Possible Breeder',
       'Pair in suitable nesting habitat', 'Probable Breeder',
       'Observed in suitable nesting habitats', 'Probable Breeder',
       //rest of cases
       'Unknown'
     );&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 03 Apr 2024 12:55:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/update-information-based-upon-variable-in-another/m-p/1405146#M8270</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-04-03T12:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: Update information based upon variable in another field (Arcade)</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/update-information-based-upon-variable-in-another/m-p/1405279#M8276</link>
      <description>&lt;P&gt;Final solution to the issue, thank you &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;&amp;nbsp; was to use Decode.&lt;/P&gt;&lt;P&gt;// Declare breed_status variable&lt;BR /&gt;var breed_status;&lt;/P&gt;&lt;P&gt;// Get the value from the original field&lt;BR /&gt;var originalValue = $feature.Doing;&lt;/P&gt;&lt;P&gt;// Determine breeding status based on original field value using Decode() function&lt;BR /&gt;breed_status = Decode($feature.Doing,&lt;BR /&gt;'Singing', 'Possible Breeder',&lt;BR /&gt;'Pair in suitable nesting habitat', 'Probable Breeder',&lt;BR /&gt;'Observed in suitable nesting habitats', 'Probable Breeder',&lt;BR /&gt;'Agitated behaviour', 'Probable Breeder',&lt;BR /&gt;'Holding permanent territory', 'Probable Breeder',&lt;BR /&gt;'Nest building or excavating', 'Probable Breeder',&lt;BR /&gt;'Visiting nest site', 'Probable Breeder',&lt;BR /&gt;'Recently fledged young, or downy young', 'Confirmed Breeder',&lt;BR /&gt;'Family party', 'Confirmed Breeder',&lt;BR /&gt;'Adults carrying faecal sac or food for young', 'Confirmed Breeder',&lt;BR /&gt;'Nest containing eggs', 'Confirmed Breeder',&lt;BR /&gt;'Nest with young seen or heard', 'Confirmed Breeder',&lt;BR /&gt;'Flying over', 'Non Breeding',&lt;BR /&gt;'Unknown' // Default value&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;// Return the determined breed_status&lt;BR /&gt;return breed_status;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 15:57:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/update-information-based-upon-variable-in-another/m-p/1405279#M8276</guid>
      <dc:creator>MattSully</dc:creator>
      <dc:date>2024-04-03T15:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: Update information based upon variable in another field (Arcade)</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/update-information-based-upon-variable-in-another/m-p/1405299#M8277</link>
      <description>&lt;P&gt;If this is your full code, then you don't need to declare the variables breed_status and originalStatus. The code in my reply utilizes an &lt;A href="https://developers.arcgis.com/arcade/guide/return/#implicit-returns" target="_self"&gt;implicit return&lt;/A&gt;, since it's a &lt;A href="https://developers.arcgis.com/arcade/guide/statements/#single-line-expressions" target="_self"&gt;single-line expression&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 16:21:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/update-information-based-upon-variable-in-another/m-p/1405299#M8277</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-04-03T16:21:49Z</dc:date>
    </item>
  </channel>
</rss>

