<?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 Preset value in Editor widget in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/preset-value-in-editor-widget/m-p/1342478#M82584</link>
    <description>&lt;P&gt;In SmartForm widget in WAB, you were able to set a preset value.&lt;/P&gt;&lt;P&gt;For example, was able with minimum JS to preset a field with the user's email&amp;nbsp; who logged in to the app.&lt;/P&gt;&lt;P&gt;Is it possible to do so in the Editor widget in JS 4.x? Can it be done using the valueExpression of the Element and define the preset value?&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/148663"&gt;@AlixVezina&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Oct 2023 03:22:29 GMT</pubDate>
    <dc:creator>LefterisKoumis</dc:creator>
    <dc:date>2023-10-27T03:22:29Z</dc:date>
    <item>
      <title>Preset value in Editor widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/preset-value-in-editor-widget/m-p/1342478#M82584</link>
      <description>&lt;P&gt;In SmartForm widget in WAB, you were able to set a preset value.&lt;/P&gt;&lt;P&gt;For example, was able with minimum JS to preset a field with the user's email&amp;nbsp; who logged in to the app.&lt;/P&gt;&lt;P&gt;Is it possible to do so in the Editor widget in JS 4.x? Can it be done using the valueExpression of the Element and define the preset value?&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/148663"&gt;@AlixVezina&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2023 03:22:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/preset-value-in-editor-widget/m-p/1342478#M82584</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2023-10-27T03:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Preset value in Editor widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/preset-value-in-editor-widget/m-p/1342639#M82587</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/14521"&gt;@LefterisKoumis&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you for posting your question.&lt;/P&gt;&lt;P&gt;You will need to create a Calculated expression in Smart Forms using the&amp;nbsp;&lt;A href="https://developers.arcgis.com/arcade/function-reference/portal_functions/#getuser" target="_self"&gt;Arcade getUser function&lt;/A&gt;. You should be able to copy this script:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var userInfo = GetUser();
if(HasValue(userInfo, "email")){
return userInfo.email;
}&lt;/LI-CODE&gt;&lt;P&gt;Here's a sample for this example:&amp;nbsp;&lt;A href="https://www.arcgis.com/apps/mapviewer/index.html?webmap=e9a4d08cc4aa416ca26369b2c0684d78" target="_blank"&gt;Preset User Email (arcgis.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlixVezina_0-1698414061330.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/84270i1522CB90E81F0AAD/image-size/large?v=v2&amp;amp;px=999" role="button" title="AlixVezina_0-1698414061330.png" alt="AlixVezina_0-1698414061330.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The expressions you create in your Smart Forms will be executed when you edit features using the Editor widget. There are examples of how to configure Calculated expressions in the Smart Forms using the Map Viewer, in this blog:&amp;nbsp;&lt;A href="https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/from-the-smart-editor-to-smart-forms/" target="_blank"&gt;From the Smart Editor to Smart Forms (esri.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2023 13:43:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/preset-value-in-editor-widget/m-p/1342639#M82587</guid>
      <dc:creator>AlixVezina</dc:creator>
      <dc:date>2023-10-27T13:43:34Z</dc:date>
    </item>
  </channel>
</rss>

