<?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: Assigning a field &amp;quot;codedValues&amp;quot; for the editor widget in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/assigning-a-field-quot-codedvalues-quot-for-the/m-p/1219881#M78936</link>
    <description>&lt;P&gt;Figured out the problem, you have to tell the setting it's a coded-value domain, the following code works:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;this._editWidgetConfiguration.push({
    layer: layer,
    formTemplate: {
        elements: [{
            type: "field",
            fieldName: "layer",
            label: "blah",
            domain: {
                codedValues: [
                    {name: "1", code: "1"},
                    {name: "2", code: "2"},
                ],
                type: 'coded-value'
            }
        }]
    }
})&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Hopefully this helps someone else &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Fri, 07 Oct 2022 15:14:32 GMT</pubDate>
    <dc:creator>AndrewMurdoch1</dc:creator>
    <dc:date>2022-10-07T15:14:32Z</dc:date>
    <item>
      <title>Assigning a field "codedValues" for the editor widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/assigning-a-field-quot-codedvalues-quot-for-the/m-p/1219875#M78935</link>
      <description>&lt;P&gt;Good Day&lt;BR /&gt;&lt;BR /&gt;I have a field visible in the editor to change how a featured is rendered, but the field itself is a string value.&amp;nbsp; Is it possible / how do It pass, codedValues in the editor config, so the input is a drop down?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if (event.added.length &amp;gt; 0) {
    this._editWidgetConfiguration = [];
    this._view.map.layers.forEach((layer) =&amp;gt; {
       this._editWidgetConfiguration.push({
           layer: layer,
           formTemplate: {
               elements: [{
                   type: "field",
                   fieldName: "layer",
                   label: "blah",
                   codedValues: [
                       {name: "1", code: "1"},
                       {name: "2", code: "2"},
                   ]
               }]
            }
        })
    });

    console.log('Edit Widget Configuration');
    console.log(_.cloneDeep(this._editWidgetConfiguration));

    this.editorWidget.layerInfos = this._editWidgetConfiguration;
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;That code is ran when layers are added to the map.&amp;nbsp; I have the list of available settings available at this point, because I've built the unqiue render settings, so how do I pass the coded values to the editor?&lt;BR /&gt;&lt;BR /&gt;The field is defined as:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
    name: 'layer',
    alias: 'layer',
    type: 'string'
},&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 14:49:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/assigning-a-field-quot-codedvalues-quot-for-the/m-p/1219875#M78935</guid>
      <dc:creator>AndrewMurdoch1</dc:creator>
      <dc:date>2022-10-07T14:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning a field "codedValues" for the editor widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/assigning-a-field-quot-codedvalues-quot-for-the/m-p/1219881#M78936</link>
      <description>&lt;P&gt;Figured out the problem, you have to tell the setting it's a coded-value domain, the following code works:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;this._editWidgetConfiguration.push({
    layer: layer,
    formTemplate: {
        elements: [{
            type: "field",
            fieldName: "layer",
            label: "blah",
            domain: {
                codedValues: [
                    {name: "1", code: "1"},
                    {name: "2", code: "2"},
                ],
                type: 'coded-value'
            }
        }]
    }
})&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Hopefully this helps someone else &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 15:14:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/assigning-a-field-quot-codedvalues-quot-for-the/m-p/1219881#M78936</guid>
      <dc:creator>AndrewMurdoch1</dc:creator>
      <dc:date>2022-10-07T15:14:32Z</dc:date>
    </item>
  </channel>
</rss>

