<?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 Return all the attributes(fields) in a feature layer for a PopupTemplate - ArcGis Javascript in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/return-all-the-attributes-fields-in-a-feature/m-p/1130026#M75756</link>
    <description>&lt;P&gt;Is there a way to return all the attributes(fields) in a feature layer for a PopupTemplate, without declaring all of them in the&amp;nbsp;fieldInfos&amp;nbsp;object in Angular?&lt;/P&gt;&lt;P&gt;.ts&lt;/P&gt;&lt;PRE&gt;const template = {
        title: "{NAME} in {COUNTY}",
        content: ,
        fieldInfos : fieldInfos
      };
      
              
     const layer = new FeatureLayer({
      url: this.featureLayerUrl,
      visible: true,
      popupTemplate : template
      });
      
      var fieldInfos = layer.map(layer.fields, function(field){
         return {
                "fieldName": field.name,
                "label": field.alias,
                "visible": true

    webmap.add(layer);
    &lt;/PRE&gt;&lt;P&gt;.html&lt;/P&gt;&lt;PRE&gt;    &amp;lt;!-- Map Div --&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;A href="https://tinyurl.com/mwfe26c2/" target="_self"&gt;I&lt;/A&gt;’m using arcgis-js-api version 4.2.1.&lt;BR /&gt;But when I use this example it is working. (But I want to set these fields dynamically.)&lt;/P&gt;&lt;PRE&gt;const fields = [{
  name: "NAME",
  alias: "Name",
  type: "string"
    }, {
  name: "County",
  alias: "County",
  type: "string"
}, {
  
const config = {
  fields: fields,
  title: "County land"
}; &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jan 2022 10:24:59 GMT</pubDate>
    <dc:creator>MuhammadArsalan27</dc:creator>
    <dc:date>2022-01-03T10:24:59Z</dc:date>
    <item>
      <title>Return all the attributes(fields) in a feature layer for a PopupTemplate - ArcGis Javascript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/return-all-the-attributes-fields-in-a-feature/m-p/1130026#M75756</link>
      <description>&lt;P&gt;Is there a way to return all the attributes(fields) in a feature layer for a PopupTemplate, without declaring all of them in the&amp;nbsp;fieldInfos&amp;nbsp;object in Angular?&lt;/P&gt;&lt;P&gt;.ts&lt;/P&gt;&lt;PRE&gt;const template = {
        title: "{NAME} in {COUNTY}",
        content: ,
        fieldInfos : fieldInfos
      };
      
              
     const layer = new FeatureLayer({
      url: this.featureLayerUrl,
      visible: true,
      popupTemplate : template
      });
      
      var fieldInfos = layer.map(layer.fields, function(field){
         return {
                "fieldName": field.name,
                "label": field.alias,
                "visible": true

    webmap.add(layer);
    &lt;/PRE&gt;&lt;P&gt;.html&lt;/P&gt;&lt;PRE&gt;    &amp;lt;!-- Map Div --&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;A href="https://tinyurl.com/mwfe26c2/" target="_self"&gt;I&lt;/A&gt;’m using arcgis-js-api version 4.2.1.&lt;BR /&gt;But when I use this example it is working. (But I want to set these fields dynamically.)&lt;/P&gt;&lt;PRE&gt;const fields = [{
  name: "NAME",
  alias: "Name",
  type: "string"
    }, {
  name: "County",
  alias: "County",
  type: "string"
}, {
  
const config = {
  fields: fields,
  title: "County land"
}; &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 10:24:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/return-all-the-attributes-fields-in-a-feature/m-p/1130026#M75756</guid>
      <dc:creator>MuhammadArsalan27</dc:creator>
      <dc:date>2022-01-03T10:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: Return all the attributes(fields) in a feature layer for a PopupTemplate - ArcGis Javascript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/return-all-the-attributes-fields-in-a-feature/m-p/1130109#M75762</link>
      <description>&lt;P&gt;You can use the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#createPopupTemplate" target="_self"&gt;createPopupTemplate&lt;/A&gt; method on the layer.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;view.when(() =&amp;gt; {
  const popupTemplate = featureLayer.createPopupTemplate();
  featureLayer.popupTemplate = popupTemplate;
});&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 03 Jan 2022 17:46:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/return-all-the-attributes-fields-in-a-feature/m-p/1130109#M75762</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2022-01-03T17:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Return all the attributes(fields) in a feature layer for a PopupTemplate - ArcGis Javascript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/return-all-the-attributes-fields-in-a-feature/m-p/1131284#M75820</link>
      <description>&lt;P&gt;You also need to set &lt;A href="http://&amp;nbsp;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled" target="_self"&gt;MapView.popup.defaultPopupTemplateEnabled&lt;/A&gt; to true on top of what&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7384"&gt;@ReneRubalcava&lt;/a&gt;&amp;nbsp; pointed out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 17:33:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/return-all-the-attributes-fields-in-a-feature/m-p/1131284#M75820</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2022-01-06T17:33:14Z</dc:date>
    </item>
  </channel>
</rss>

