<?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 display the fields of a layer in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-display-the-fields-of-a-layer/m-p/79762#M3128</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sara,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Your issue is that you are concatenating the object with a string so it is giving you a string version of the object which will be "[Object Object]"&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;console.log("selectedLayer.layerObject: "+selectedLayer.layerObject); // [Object Object]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Change this to&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;console.log(selectedLayer.layerObject);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;instead and now the console will print the object with all its properties and functions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Sep 2018 12:43:17 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2018-09-14T12:43:17Z</dc:date>
    <item>
      <title>How to display the fields of a layer</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-display-the-fields-of-a-layer/m-p/79761#M3127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;I'm new to developing with arcGIS web app-builder,&lt;/P&gt;&lt;P&gt;I want to show the layers added on the map (they're coming from my arcGIS server map service) and once I choose a layer, its fields will be displayed in the other list drop-down, such a widget is available on the app-builders docs but it's not working for me, maybe because it's only for 'ArcGIS Feature Layer', you can find it here:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/web-appbuilder/sample-code/create-a-listview-widget.htm" title="https://developers.arcgis.com/web-appbuilder/sample-code/create-a-listview-widget.htm"&gt;Create a ListView widget—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;define([&lt;BR /&gt; 'dojo/_base/declare',&lt;BR /&gt; 'jimu/BaseWidgetSetting',&lt;BR /&gt; 'dojo/_base/lang',&lt;BR /&gt; 'dojo/_base/array',&lt;BR /&gt; 'dijit/_WidgetsInTemplateMixin',&lt;BR /&gt; 'jimu/LayerInfos/LayerInfos',&lt;BR /&gt; 'dijit/form/Select'&lt;BR /&gt;],&lt;BR /&gt;function(declare, BaseWidgetSetting, lang, array, _WidgetsInTemplateMixin, LayerInfos) {&lt;/P&gt;&lt;P&gt;return declare([BaseWidgetSetting, _WidgetsInTemplateMixin], {&lt;BR /&gt; baseClass: 'jimu-widget-listview-setting',&lt;/P&gt;&lt;P&gt;postCreate: function(){&lt;BR /&gt; //the config object is passed in&lt;BR /&gt; this.setConfig(this.config);&lt;BR /&gt; },&lt;/P&gt;&lt;P&gt;setConfig: function(config){&lt;BR /&gt; // this.textNode.value = config.configText;&lt;BR /&gt; // Update header text&lt;BR /&gt; //you can change the default string named "headerText" defined at nls/string.js with a variable defined in config.json&lt;BR /&gt; this.headerTextNode.value = config.widgetHeaderText;&lt;BR /&gt; &lt;BR /&gt; // Get all feature layers from the map&lt;BR /&gt; LayerInfos.getInstance(this.map, this.map.itemInfo)&lt;BR /&gt; .then(lang.hitch(this, function(layerInfosObj) {&lt;BR /&gt; var infos = layerInfosObj.getLayerInfoArray();&lt;BR /&gt; var options = [];&lt;BR /&gt; array.forEach(infos, function(info) {&lt;BR /&gt; // if(info.originOperLayer.layerType === 'ArcGISFeatureLayer') {&lt;BR /&gt; options.push({&lt;BR /&gt; label: info.title,&lt;BR /&gt; value: info.id&lt;BR /&gt; });&lt;BR /&gt; // }&lt;BR /&gt; });&lt;BR /&gt; this. layerSelect.set('options', options);&lt;BR /&gt; &lt;BR /&gt; this.layerSelect.on('change', lang.hitch(this, function(value) {&lt;BR /&gt; &lt;BR /&gt; //alert('value of layerId is :' +value);&lt;BR /&gt; var selectedLayer = layerInfosObj.getLayerInfoById(value);&lt;BR /&gt; console.log("selectedLayer: "+selectedLayer); // [Object Object]&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;console.log("selectedLayer.layerObject: "+selectedLayer.layerObject); // [Object Object]&lt;/SPAN&gt;&lt;BR /&gt; console.log("selectedLayer.layerObject.fields: "+selectedLayer.layerObject.fields); //undefined&lt;BR /&gt; console.log("selectedLayer.layerObject0: "+selectedLayer.layerObject[0]); //undefined&lt;BR /&gt; console.log("selectedLayer.layerObject1: "+selectedLayer.layerObject[1]); //undefined&lt;BR /&gt; if(selectedLayer) {&lt;BR /&gt; var fieldOptions = array.map(selectedLayer.layerObject.fields, function(field) {&lt;BR /&gt; return {&lt;BR /&gt; label: field.alias || field.name,&lt;BR /&gt; value: field.name&lt;BR /&gt; }&lt;BR /&gt; });&lt;BR /&gt; this.thumbnailSelect.set('options', fieldOptions);&lt;BR /&gt; this.titleSelect.set('options', fieldOptions);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;}));&lt;BR /&gt; })); &lt;BR /&gt; },&lt;/P&gt;&lt;P&gt;getConfig: function(){&lt;BR /&gt; //WAB will get config object through this method&lt;BR /&gt; /*return {&lt;BR /&gt; configText: this.textNode.value&lt;BR /&gt; };*/&lt;BR /&gt; //WAB will get config object through this method&lt;BR /&gt; return {&lt;BR /&gt; widgetHeaderText: this.headerTextNode.value,&lt;BR /&gt; layerId: this.layerSelect.get('value'),&lt;BR /&gt; thumbnailField: this.thumbnailSelect.get('value'),&lt;BR /&gt; titleField: this.titleSelect.get('value')&lt;BR /&gt; };&lt;BR /&gt; }&lt;BR /&gt; });&lt;BR /&gt;});&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When using Breakpoints while debugging, I can't find the "Fields" property in the layerObject object, where I can find it ?&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3101"&gt;Robert Scheitlin, GISP&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2018 09:26:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-display-the-fields-of-a-layer/m-p/79761#M3127</guid>
      <dc:creator>SaraEL_MALKI</dc:creator>
      <dc:date>2018-09-14T09:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the fields of a layer</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-display-the-fields-of-a-layer/m-p/79762#M3128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sara,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Your issue is that you are concatenating the object with a string so it is giving you a string version of the object which will be "[Object Object]"&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;console.log("selectedLayer.layerObject: "+selectedLayer.layerObject); // [Object Object]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Change this to&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;console.log(selectedLayer.layerObject);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;instead and now the console will print the object with all its properties and functions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2018 12:43:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-display-the-fields-of-a-layer/m-p/79762#M3128</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-09-14T12:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the fields of a layer</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-display-the-fields-of-a-layer/m-p/79763#M3129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;thank you, but there is no "field" property,&amp;nbsp;How can I&amp;nbsp;find the fields of a layer ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2018 14:10:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-display-the-fields-of-a-layer/m-p/79763#M3129</guid>
      <dc:creator>SaraEL_MALKI</dc:creator>
      <dc:date>2018-09-14T14:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the fields of a layer</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-display-the-fields-of-a-layer/m-p/79764#M3130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sara,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Is&amp;nbsp;&lt;SPAN&gt;selectedLayer or&amp;nbsp;&lt;/SPAN&gt;selectedLayer.layerObject null?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2018 14:28:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-display-the-fields-of-a-layer/m-p/79764#M3130</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-09-14T14:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the fields of a layer</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-display-the-fields-of-a-layer/m-p/79765#M3131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;It is not, but I can't find the fields of the layer&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/421900_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2018 14:49:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-display-the-fields-of-a-layer/m-p/79765#M3131</guid>
      <dc:creator>SaraEL_MALKI</dc:creator>
      <dc:date>2018-09-14T14:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the fields of a layer</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-display-the-fields-of-a-layer/m-p/79766#M3132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sara,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;That looks like you are using a ArcGISMapServiceLayer and not a FeatureLayer and that is definitely the issue. There is a reason that the sample is programmed to only allow FeatureLayers to be added to the dropdown.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2018 14:53:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-display-the-fields-of-a-layer/m-p/79766#M3132</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-09-14T14:53:49Z</dc:date>
    </item>
  </channel>
</rss>

