<?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 Custom Experience Builder widget dropdown value will not populate in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/custom-experience-builder-widget-dropdown-value/m-p/1179904#M4546</link>
    <description>&lt;P&gt;I am working on a custom widget and we are using the a configuration file to feed in additional parameters to the initialized widget. When we are setting up the widget for a new app we have a list of drop downs that we are using to set the parameters for the widget, but when we select the item from the drop down the value is not displaying.&lt;/P&gt;&lt;P data-unlink="true"&gt;We are using `UseDataSource` in the drop down menus for the map and the layer that we are connecting to, but &lt;STRONG&gt;we use config to set key value pairs for custom values that we are passing to the widget.&lt;/STRONG&gt; When I looked into the &lt;A href="https://github.com/Esri/arcgis-experience-builder-sdk-resources/blob/master/widgets/feature-layer-class/src/setting/setting.tsx" target="_self"&gt;feature-layer-class widget example&lt;/A&gt;&amp;nbsp; the `FieldSelector` components are setting a key called fields on `UseDataSources` that has a type of an array of string, but we have a lot of fields and would rather have an object associated with these to access keys.&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;STRONG&gt;I have looked at the `jimu-ui` docs for `FieldSelector` but it is not list&lt;/STRONG&gt; and looked into the `Dropdown` in Reactstrap, but I am not able to make heads or tails of it.&lt;BR /&gt;&lt;BR /&gt;Is there something that I am doing wrong to populate these fields, is there documentation that I am missing out on.&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;STRONG&gt;It would be helpful if we had a `value` prop to the `FieldSelector` drop down to set a custom value from a config object.&lt;/STRONG&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;/** @jsx */
import { React, jsx, Immutable, DataSourceTypes, UseDataSource } from 'jimu-core';
import { AllWidgetSettingProps } from 'jimu-for-builder';
import { IMConfig } from '../config';
import {
  JimuMapViewSelector,
  SettingSection,
  SettingRow,
} from 'jimu-ui/advanced/setting-components';
import {
  AllDataSourceTypes,
  DataSourceSelector,
  FieldSelector,
} from 'jimu-ui/advanced/data-source-selector';

export class Setting extends React.PureComponent&amp;lt;AllWidgetSettingProps&amp;lt;IMConfig&amp;gt;, any&amp;gt; {
  supportedTypes = Immutable([DataSourceTypes.FeatureLayer]);
  onMapWidgetSelected = (useMapWidgetIds: string[]) =&amp;gt; {
    this.props.onSettingChange({
      id: this.props.id,
      useMapWidgetIds: useMapWidgetIds,
      config: this.props.config.set('layerId', useMapWidgetIds[0]),
    });
  };

  onDataSourceChange = (useDataSources: UseDataSource[]) =&amp;gt; {
    this.props.onSettingChange({
      id: this.props.id,
      useDataSources: useDataSources,
    });
  };

  setPropertyFieldName = (fieldProperty, fieldName) =&amp;gt; {
    this.props.onSettingChange({
      id: this.props.id,
      config: this.props.config.set(fieldProperty, fieldName),
    });
    console.log(this.props.config);
  };

  onToggleUseDataEnabled = (args) =&amp;gt; {
    console.log({ args });
  };

  render() {
    return (
      &amp;lt;div&amp;gt;
        &amp;lt;div className='widget-setting-br-buffer-tool'&amp;gt;
          &amp;lt;SettingSection className='map-selector-section' title='Select Map'&amp;gt;
            &amp;lt;SettingRow&amp;gt;
              &amp;lt;JimuMapViewSelector
                onSelect={this.onMapWidgetSelected}
                useMapWidgetIds={this.props.useMapWidgetIds}
              /&amp;gt;
            &amp;lt;/SettingRow&amp;gt;
          &amp;lt;/SettingSection&amp;gt;
          &amp;lt;SettingSection className='map-selector-section' title='Select Parcel Layer'&amp;gt;
            &amp;lt;SettingRow&amp;gt;
              &amp;lt;DataSourceSelector
                mustUseDataSource
                types={Immutable([AllDataSourceTypes.FeatureLayer])}
                useDataSources={this.props.useDataSources}
                onChange={this.onDataSourceChange}
                widgetId={this.props.id}
              /&amp;gt;
            &amp;lt;/SettingRow&amp;gt;
          &amp;lt;/SettingSection&amp;gt;
          {this.props.useDataSources &amp;amp;&amp;amp; this.props.useDataSources.length &amp;gt; 0 &amp;amp;&amp;amp; (
            &amp;lt;React.Fragment&amp;gt;
              &amp;lt;SettingSection className='map-selector-section' title='OID field'&amp;gt;
                &amp;lt;FieldSelector
                  useDataSources={this.props.useDataSources}
                  isMultiple={false}
                  isDataSourceDropDownHidden={true}
                  isSearchInputHidden={false}
                  useDropdown={true}
                  placeholder={'Select OID field'}
                  useDefault={false}
                  onChange={(evt) =&amp;gt; this.setPropertyFieldName('oidField', evt[0].name)}
                /&amp;gt;
              &amp;lt;/SettingSection&amp;gt;
              &amp;lt;SettingSection className='map-selector-section' title='PIN field'&amp;gt;
                &amp;lt;FieldSelector
                  useDataSources={this.props.useDataSources}
                  isMultiple={false}
                  isDataSourceDropDownHidden={true}
                  isSearchInputHidden={false}
                  useDropdown={true}
                  placeholder={'Select PIN field'}
                  useDefault={false}
                  onChange={(evt) =&amp;gt; this.setPropertyFieldName('pinField', evt[0].name)}
                /&amp;gt;
              &amp;lt;/SettingSection&amp;gt;
              &amp;lt;SettingSection className='map-selector-section' title='Owner field'&amp;gt;
                &amp;lt;FieldSelector
                  useDataSources={this.props.useDataSources}
                  isMultiple={false}
                  isDataSourceDropDownHidden={true}
                  isSearchInputHidden={false}
                  useDropdown={true}
                  placeholder={'Select Owner field'}
                  useDefault={false}
                  onChange={(evt) =&amp;gt; this.setPropertyFieldName('ownerField', evt[0].name)}
                /&amp;gt;
              &amp;lt;/SettingSection&amp;gt;
              &amp;lt;SettingSection className='map-selector-section' title='Street # field'&amp;gt;
                &amp;lt;FieldSelector
                  useDataSources={this.props.useDataSources}
                  isMultiple={false}
                  isDataSourceDropDownHidden={true}
                  isSearchInputHidden={false}
                  useDropdown={true}
                  placeholder={'Select Street# field'}
                  useDefault={false}
                  onChange={(evt) =&amp;gt; this.setPropertyFieldName('streetNberField', evt[0].name)}
                /&amp;gt;
              &amp;lt;/SettingSection&amp;gt;
              &amp;lt;SettingSection className='map-selector-section' title='Street name field'&amp;gt;
                &amp;lt;FieldSelector
                  useDataSources={this.props.useDataSources}
                  isMultiple={false}
                  isDataSourceDropDownHidden={true}
                  isSearchInputHidden={false}
                  useDropdown={true}
                  placeholder={'Select Street name field'}
                  useDefault={false}
                  onChange={(evt) =&amp;gt; this.setPropertyFieldName('streetNameField', evt[0].name)}
                /&amp;gt;
              &amp;lt;/SettingSection&amp;gt;
              &amp;lt;SettingSection className='map-selector-section' title='Street type field'&amp;gt;
                &amp;lt;FieldSelector
                  useDataSources={this.props.useDataSources}
                  isMultiple={false}
                  isDataSourceDropDownHidden={true}
                  isSearchInputHidden={false}
                  useDropdown={true}
                  placeholder={'Select Street suffix field'}
                  useDefault={false}
                  onChange={(evt) =&amp;gt; this.setPropertyFieldName('streetSuffixField', evt[0].name)}
                /&amp;gt;
              &amp;lt;/SettingSection&amp;gt;
              &amp;lt;SettingSection className='map-selector-section' title='City field'&amp;gt;
                &amp;lt;FieldSelector
                  useDataSources={this.props.useDataSources}
                  isMultiple={false}
                  isDataSourceDropDownHidden={true}
                  isSearchInputHidden={false}
                  useDropdown={true}
                  placeholder={'Select city field'}
                  useDefault={false}
                  onChange={(evt) =&amp;gt; this.setPropertyFieldName('cityField', evt[0].name)}
                /&amp;gt;
              &amp;lt;/SettingSection&amp;gt;
              &amp;lt;SettingSection className='map-selector-section' title='State field'&amp;gt;
                &amp;lt;FieldSelector
                  useDataSources={this.props.useDataSources}
                  isMultiple={false}
                  isDataSourceDropDownHidden={true}
                  isSearchInputHidden={false}
                  useDropdown={true}
                  placeholder={'Select state field'}
                  useDefault={false}
                  onChange={(evt) =&amp;gt; this.setPropertyFieldName('stateField', evt[0].name)}
                /&amp;gt;
              &amp;lt;/SettingSection&amp;gt;
              &amp;lt;SettingSection className='map-selector-section' title='Zip Code field'&amp;gt;
                &amp;lt;FieldSelector
                  useDataSources={this.props.useDataSources}
                  isMultiple={false}
                  isDataSourceDropDownHidden={true}
                  isSearchInputHidden={false}
                  useDropdown={true}
                  placeholder={'Select zipcode field'}
                  useDefault={false}
                  onChange={(evt) =&amp;gt; this.setPropertyFieldName('zipCodeField', evt[0].name)}
                /&amp;gt;
              &amp;lt;/SettingSection&amp;gt;
            &amp;lt;/React.Fragment&amp;gt;
          )}
        &amp;lt;/div&amp;gt;
      &amp;lt;/div&amp;gt;
    );
  }
}

export default Setting;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jun 2022 19:17:37 GMT</pubDate>
    <dc:creator>wjenkins</dc:creator>
    <dc:date>2022-06-03T19:17:37Z</dc:date>
    <item>
      <title>Custom Experience Builder widget dropdown value will not populate</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/custom-experience-builder-widget-dropdown-value/m-p/1179904#M4546</link>
      <description>&lt;P&gt;I am working on a custom widget and we are using the a configuration file to feed in additional parameters to the initialized widget. When we are setting up the widget for a new app we have a list of drop downs that we are using to set the parameters for the widget, but when we select the item from the drop down the value is not displaying.&lt;/P&gt;&lt;P data-unlink="true"&gt;We are using `UseDataSource` in the drop down menus for the map and the layer that we are connecting to, but &lt;STRONG&gt;we use config to set key value pairs for custom values that we are passing to the widget.&lt;/STRONG&gt; When I looked into the &lt;A href="https://github.com/Esri/arcgis-experience-builder-sdk-resources/blob/master/widgets/feature-layer-class/src/setting/setting.tsx" target="_self"&gt;feature-layer-class widget example&lt;/A&gt;&amp;nbsp; the `FieldSelector` components are setting a key called fields on `UseDataSources` that has a type of an array of string, but we have a lot of fields and would rather have an object associated with these to access keys.&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;STRONG&gt;I have looked at the `jimu-ui` docs for `FieldSelector` but it is not list&lt;/STRONG&gt; and looked into the `Dropdown` in Reactstrap, but I am not able to make heads or tails of it.&lt;BR /&gt;&lt;BR /&gt;Is there something that I am doing wrong to populate these fields, is there documentation that I am missing out on.&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;STRONG&gt;It would be helpful if we had a `value` prop to the `FieldSelector` drop down to set a custom value from a config object.&lt;/STRONG&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;/** @jsx */
import { React, jsx, Immutable, DataSourceTypes, UseDataSource } from 'jimu-core';
import { AllWidgetSettingProps } from 'jimu-for-builder';
import { IMConfig } from '../config';
import {
  JimuMapViewSelector,
  SettingSection,
  SettingRow,
} from 'jimu-ui/advanced/setting-components';
import {
  AllDataSourceTypes,
  DataSourceSelector,
  FieldSelector,
} from 'jimu-ui/advanced/data-source-selector';

export class Setting extends React.PureComponent&amp;lt;AllWidgetSettingProps&amp;lt;IMConfig&amp;gt;, any&amp;gt; {
  supportedTypes = Immutable([DataSourceTypes.FeatureLayer]);
  onMapWidgetSelected = (useMapWidgetIds: string[]) =&amp;gt; {
    this.props.onSettingChange({
      id: this.props.id,
      useMapWidgetIds: useMapWidgetIds,
      config: this.props.config.set('layerId', useMapWidgetIds[0]),
    });
  };

  onDataSourceChange = (useDataSources: UseDataSource[]) =&amp;gt; {
    this.props.onSettingChange({
      id: this.props.id,
      useDataSources: useDataSources,
    });
  };

  setPropertyFieldName = (fieldProperty, fieldName) =&amp;gt; {
    this.props.onSettingChange({
      id: this.props.id,
      config: this.props.config.set(fieldProperty, fieldName),
    });
    console.log(this.props.config);
  };

  onToggleUseDataEnabled = (args) =&amp;gt; {
    console.log({ args });
  };

  render() {
    return (
      &amp;lt;div&amp;gt;
        &amp;lt;div className='widget-setting-br-buffer-tool'&amp;gt;
          &amp;lt;SettingSection className='map-selector-section' title='Select Map'&amp;gt;
            &amp;lt;SettingRow&amp;gt;
              &amp;lt;JimuMapViewSelector
                onSelect={this.onMapWidgetSelected}
                useMapWidgetIds={this.props.useMapWidgetIds}
              /&amp;gt;
            &amp;lt;/SettingRow&amp;gt;
          &amp;lt;/SettingSection&amp;gt;
          &amp;lt;SettingSection className='map-selector-section' title='Select Parcel Layer'&amp;gt;
            &amp;lt;SettingRow&amp;gt;
              &amp;lt;DataSourceSelector
                mustUseDataSource
                types={Immutable([AllDataSourceTypes.FeatureLayer])}
                useDataSources={this.props.useDataSources}
                onChange={this.onDataSourceChange}
                widgetId={this.props.id}
              /&amp;gt;
            &amp;lt;/SettingRow&amp;gt;
          &amp;lt;/SettingSection&amp;gt;
          {this.props.useDataSources &amp;amp;&amp;amp; this.props.useDataSources.length &amp;gt; 0 &amp;amp;&amp;amp; (
            &amp;lt;React.Fragment&amp;gt;
              &amp;lt;SettingSection className='map-selector-section' title='OID field'&amp;gt;
                &amp;lt;FieldSelector
                  useDataSources={this.props.useDataSources}
                  isMultiple={false}
                  isDataSourceDropDownHidden={true}
                  isSearchInputHidden={false}
                  useDropdown={true}
                  placeholder={'Select OID field'}
                  useDefault={false}
                  onChange={(evt) =&amp;gt; this.setPropertyFieldName('oidField', evt[0].name)}
                /&amp;gt;
              &amp;lt;/SettingSection&amp;gt;
              &amp;lt;SettingSection className='map-selector-section' title='PIN field'&amp;gt;
                &amp;lt;FieldSelector
                  useDataSources={this.props.useDataSources}
                  isMultiple={false}
                  isDataSourceDropDownHidden={true}
                  isSearchInputHidden={false}
                  useDropdown={true}
                  placeholder={'Select PIN field'}
                  useDefault={false}
                  onChange={(evt) =&amp;gt; this.setPropertyFieldName('pinField', evt[0].name)}
                /&amp;gt;
              &amp;lt;/SettingSection&amp;gt;
              &amp;lt;SettingSection className='map-selector-section' title='Owner field'&amp;gt;
                &amp;lt;FieldSelector
                  useDataSources={this.props.useDataSources}
                  isMultiple={false}
                  isDataSourceDropDownHidden={true}
                  isSearchInputHidden={false}
                  useDropdown={true}
                  placeholder={'Select Owner field'}
                  useDefault={false}
                  onChange={(evt) =&amp;gt; this.setPropertyFieldName('ownerField', evt[0].name)}
                /&amp;gt;
              &amp;lt;/SettingSection&amp;gt;
              &amp;lt;SettingSection className='map-selector-section' title='Street # field'&amp;gt;
                &amp;lt;FieldSelector
                  useDataSources={this.props.useDataSources}
                  isMultiple={false}
                  isDataSourceDropDownHidden={true}
                  isSearchInputHidden={false}
                  useDropdown={true}
                  placeholder={'Select Street# field'}
                  useDefault={false}
                  onChange={(evt) =&amp;gt; this.setPropertyFieldName('streetNberField', evt[0].name)}
                /&amp;gt;
              &amp;lt;/SettingSection&amp;gt;
              &amp;lt;SettingSection className='map-selector-section' title='Street name field'&amp;gt;
                &amp;lt;FieldSelector
                  useDataSources={this.props.useDataSources}
                  isMultiple={false}
                  isDataSourceDropDownHidden={true}
                  isSearchInputHidden={false}
                  useDropdown={true}
                  placeholder={'Select Street name field'}
                  useDefault={false}
                  onChange={(evt) =&amp;gt; this.setPropertyFieldName('streetNameField', evt[0].name)}
                /&amp;gt;
              &amp;lt;/SettingSection&amp;gt;
              &amp;lt;SettingSection className='map-selector-section' title='Street type field'&amp;gt;
                &amp;lt;FieldSelector
                  useDataSources={this.props.useDataSources}
                  isMultiple={false}
                  isDataSourceDropDownHidden={true}
                  isSearchInputHidden={false}
                  useDropdown={true}
                  placeholder={'Select Street suffix field'}
                  useDefault={false}
                  onChange={(evt) =&amp;gt; this.setPropertyFieldName('streetSuffixField', evt[0].name)}
                /&amp;gt;
              &amp;lt;/SettingSection&amp;gt;
              &amp;lt;SettingSection className='map-selector-section' title='City field'&amp;gt;
                &amp;lt;FieldSelector
                  useDataSources={this.props.useDataSources}
                  isMultiple={false}
                  isDataSourceDropDownHidden={true}
                  isSearchInputHidden={false}
                  useDropdown={true}
                  placeholder={'Select city field'}
                  useDefault={false}
                  onChange={(evt) =&amp;gt; this.setPropertyFieldName('cityField', evt[0].name)}
                /&amp;gt;
              &amp;lt;/SettingSection&amp;gt;
              &amp;lt;SettingSection className='map-selector-section' title='State field'&amp;gt;
                &amp;lt;FieldSelector
                  useDataSources={this.props.useDataSources}
                  isMultiple={false}
                  isDataSourceDropDownHidden={true}
                  isSearchInputHidden={false}
                  useDropdown={true}
                  placeholder={'Select state field'}
                  useDefault={false}
                  onChange={(evt) =&amp;gt; this.setPropertyFieldName('stateField', evt[0].name)}
                /&amp;gt;
              &amp;lt;/SettingSection&amp;gt;
              &amp;lt;SettingSection className='map-selector-section' title='Zip Code field'&amp;gt;
                &amp;lt;FieldSelector
                  useDataSources={this.props.useDataSources}
                  isMultiple={false}
                  isDataSourceDropDownHidden={true}
                  isSearchInputHidden={false}
                  useDropdown={true}
                  placeholder={'Select zipcode field'}
                  useDefault={false}
                  onChange={(evt) =&amp;gt; this.setPropertyFieldName('zipCodeField', evt[0].name)}
                /&amp;gt;
              &amp;lt;/SettingSection&amp;gt;
            &amp;lt;/React.Fragment&amp;gt;
          )}
        &amp;lt;/div&amp;gt;
      &amp;lt;/div&amp;gt;
    );
  }
}

export default Setting;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 19:17:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/custom-experience-builder-widget-dropdown-value/m-p/1179904#M4546</guid>
      <dc:creator>wjenkins</dc:creator>
      <dc:date>2022-06-03T19:17:37Z</dc:date>
    </item>
  </channel>
</rss>

