<?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: Preset value in Editor widget in a JS app using the setValue in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/preset-value-in-editor-widget-in-a-js-app-using/m-p/1352700#M82898</link>
    <description>&lt;P&gt;I found adding a bit of asynchronous delay seems to do the trick:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;editorVM.watch(['state', 'featureFormViewModel.feature', 'featureFormViewModel.state'], () =&amp;gt; {
  if (editorVM.state == 'creating-features' &amp;amp;&amp;amp; editorVM.featureFormViewModel.feature &amp;amp;&amp;amp; editorVM.featureFormViewModel.state == 'ready') { 
    window.setTimeout(function() {
      editorVM.featureFormViewModel.setValue('PhoneNumber', "999.999.999")
    }, 200);
  }  
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You'll want to be careful this workflow doesn't inadvertently overwrite something the user manually enters; I didn't test for that kind of thing.&lt;/P&gt;</description>
    <pubDate>Wed, 22 Nov 2023 18:00:56 GMT</pubDate>
    <dc:creator>JoelBennett</dc:creator>
    <dc:date>2023-11-22T18:00:56Z</dc:date>
    <item>
      <title>Preset value in Editor widget in a JS app using the setValue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/preset-value-in-editor-widget-in-a-js-app-using/m-p/1352220#M82862</link>
      <description>&lt;P&gt;I have this simple JS app and trying to preset the value of a field. On this example is the Phone Number field but I want to know what am I doing wrong and I can't preset it using the setValue property.&lt;/P&gt;&lt;P&gt;This is the property:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#setValue" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#setValue&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/lkoumis1/pen/WNPrxZB?editors=1001" target="_self"&gt;Here is the app.&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 20:16:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/preset-value-in-editor-widget-in-a-js-app-using/m-p/1352220#M82862</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2023-11-21T20:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: Preset value in Editor widget in a JS app using the setValue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/preset-value-in-editor-widget-in-a-js-app-using/m-p/1352700#M82898</link>
      <description>&lt;P&gt;I found adding a bit of asynchronous delay seems to do the trick:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;editorVM.watch(['state', 'featureFormViewModel.feature', 'featureFormViewModel.state'], () =&amp;gt; {
  if (editorVM.state == 'creating-features' &amp;amp;&amp;amp; editorVM.featureFormViewModel.feature &amp;amp;&amp;amp; editorVM.featureFormViewModel.state == 'ready') { 
    window.setTimeout(function() {
      editorVM.featureFormViewModel.setValue('PhoneNumber', "999.999.999")
    }, 200);
  }  
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You'll want to be careful this workflow doesn't inadvertently overwrite something the user manually enters; I didn't test for that kind of thing.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 18:00:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/preset-value-in-editor-widget-in-a-js-app-using/m-p/1352700#M82898</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-11-22T18:00:56Z</dc:date>
    </item>
  </channel>
</rss>

