<?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: How to assign value to field using Arcade calculated value in ArcGIS Field Maps Questions</title>
    <link>https://community.esri.com/t5/arcgis-field-maps-questions/how-to-assign-value-to-field-using-arcade/m-p/1279238#M5771</link>
    <description>&lt;P&gt;You can not assign a value to a field in this way. $feature.[any field name] is a constant during the execution of any expression.&amp;nbsp; All you need to do is return the string "Asset".&amp;nbsp;&lt;/P&gt;&lt;P&gt;In designer, select the field Survey_Type. Then add a field calculation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;return "Asset"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Here is some helpful documentation.&amp;nbsp;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/arcade/guide/variables/" target="_blank"&gt;https://developers.arcgis.com/arcade/guide/variables/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/arcade/guide/return/" target="_blank"&gt;https://developers.arcgis.com/arcade/guide/return/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Apr 2023 13:48:20 GMT</pubDate>
    <dc:creator>JustinReynolds</dc:creator>
    <dc:date>2023-04-17T13:48:20Z</dc:date>
    <item>
      <title>How to assign value to field using Arcade calculated value</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/how-to-assign-value-to-field-using-arcade/m-p/1279117#M5765</link>
      <description>&lt;P&gt;I wish to pre-populate the a field (Survey_Type) in my form with a Domain value "Asset" and have been attempting to do this using an Arcade expression. The expression&amp;nbsp;returns false, and the value isn't added:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Survey_Type&lt;/SPAN&gt;&lt;SPAN&gt; == &lt;/SPAN&gt;&lt;SPAN&gt;"Asset"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am i doing wrong?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 00:46:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/how-to-assign-value-to-field-using-arcade/m-p/1279117#M5765</guid>
      <dc:creator>OliverIshmael</dc:creator>
      <dc:date>2023-04-17T00:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign value to field using Arcade calculated value</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/how-to-assign-value-to-field-using-arcade/m-p/1279118#M5766</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Two equal signs is a comparison -- One equal is an assignment&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to assign the vale then I think you want --&amp;nbsp;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Survey_Type&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"Asset"&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 02:05:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/how-to-assign-value-to-field-using-arcade/m-p/1279118#M5766</guid>
      <dc:creator>JeffSilberberg</dc:creator>
      <dc:date>2023-04-17T02:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign value to field using Arcade calculated value</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/how-to-assign-value-to-field-using-arcade/m-p/1279172#M5768</link>
      <description>&lt;P&gt;Unfortunately, I already tried that. In red text Field Maps form says:&lt;/P&gt;&lt;P&gt;'Failed to calculate'&lt;/P&gt;&lt;P&gt;[ARCADE] - Expression failed to evaluate: \nName: expr/survey-type--asset\nError:java.util.concurrent.ExecutionException:com.esriarcgisruntime.ArcGISRuntimeException:Arcade expression is invalid.: Arcade evaluation error. Evaluation_error_code::cannot_assign_to_const_value Line:1&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 09:59:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/how-to-assign-value-to-field-using-arcade/m-p/1279172#M5768</guid>
      <dc:creator>OliverIshmael</dc:creator>
      <dc:date>2023-04-17T09:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign value to field using Arcade calculated value</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/how-to-assign-value-to-field-using-arcade/m-p/1279238#M5771</link>
      <description>&lt;P&gt;You can not assign a value to a field in this way. $feature.[any field name] is a constant during the execution of any expression.&amp;nbsp; All you need to do is return the string "Asset".&amp;nbsp;&lt;/P&gt;&lt;P&gt;In designer, select the field Survey_Type. Then add a field calculation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;return "Asset"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Here is some helpful documentation.&amp;nbsp;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/arcade/guide/variables/" target="_blank"&gt;https://developers.arcgis.com/arcade/guide/variables/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/arcade/guide/return/" target="_blank"&gt;https://developers.arcgis.com/arcade/guide/return/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 13:48:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/how-to-assign-value-to-field-using-arcade/m-p/1279238#M5771</guid>
      <dc:creator>JustinReynolds</dc:creator>
      <dc:date>2023-04-17T13:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign value to field using Arcade calculated value</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/how-to-assign-value-to-field-using-arcade/m-p/1279344#M5772</link>
      <description>&lt;P&gt;You might need to return the Domain Code and not the value.&lt;/P&gt;&lt;P&gt;You could also just set "Asset" as the default value in the template.&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 17:41:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/how-to-assign-value-to-field-using-arcade/m-p/1279344#M5772</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2023-04-17T17:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign value to field using Arcade calculated value</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/how-to-assign-value-to-field-using-arcade/m-p/1290508#M6055</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/183291"&gt;@JustinReynolds&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/15530"&gt;@RhettZufelt&lt;/a&gt;&amp;nbsp;I tried both of your suggestions (using calculated values, or, using default value) but neither of them result in a value being added to the field. The form completes successfully, but when i view the feature layer data no value has been saved for that field.&lt;/P&gt;&lt;P&gt;Do you know why this might be?&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 00:44:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/how-to-assign-value-to-field-using-arcade/m-p/1290508#M6055</guid>
      <dc:creator>OliverIshmael</dc:creator>
      <dc:date>2023-05-18T00:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign value to field using Arcade calculated value</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/how-to-assign-value-to-field-using-arcade/m-p/1290512#M6056</link>
      <description>&lt;P&gt;Can you provide more details, I'd prefer not guess.&lt;BR /&gt;&lt;BR /&gt;Please post your expressions in a JavaScript code block or screenshot it. Screenshot the Form as it is being completed, the popup afterword and the feature layer data you say is not being populated.&lt;BR /&gt;&lt;BR /&gt;A screenshot of the field with its domain values would also be helpful.&lt;BR /&gt;&lt;BR /&gt;Also, when you create the expression does it work when you test it in Field Maps Designer?&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 01:26:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/how-to-assign-value-to-field-using-arcade/m-p/1290512#M6056</guid>
      <dc:creator>JustinReynolds</dc:creator>
      <dc:date>2023-05-18T01:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign value to field using Arcade calculated value</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/how-to-assign-value-to-field-using-arcade/m-p/1290568#M6059</link>
      <description>&lt;P&gt;Thank you for offering to help. Bizarrely it wasn't working yesterday but it is now. So that's good...i think?!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 10:01:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/how-to-assign-value-to-field-using-arcade/m-p/1290568#M6059</guid>
      <dc:creator>OliverIshmael</dc:creator>
      <dc:date>2023-05-18T10:01:05Z</dc:date>
    </item>
  </channel>
</rss>

