<?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 get fields of Dynamic Layer hosted by ArcGIS Server? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-get-fields-of-dynamic-layer-hosted-by/m-p/1535329#M85605</link>
    <description>&lt;P&gt;You can create a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html" target="_self"&gt;FeatureLayer&lt;/A&gt; object from the REST endpoint URL, and get the information from its &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields" target="_self"&gt;fields&lt;/A&gt; collection after it loads:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const featureLayer = new FeatureLayer({
	url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0"
});

featureLayer.when(function() {
	featureLayer.fields.forEach(function(field) {
		console.info(field.name + " ( type: " + field.type + ", alias: " + field.alias + " )");
	});
});

featureLayer.load();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Sep 2024 22:44:39 GMT</pubDate>
    <dc:creator>JoelBennett</dc:creator>
    <dc:date>2024-09-04T22:44:39Z</dc:date>
    <item>
      <title>How to get fields of Dynamic Layer hosted by ArcGIS Server?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-get-fields-of-dynamic-layer-hosted-by/m-p/1535300#M85604</link>
      <description>&lt;P&gt;How to get fields of Dynamic Layer hosted by ArcGIS Server using JavaScript?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ForrestLin_0-1725483838327.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/114310i9CE4694341EE3D63/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ForrestLin_0-1725483838327.png" alt="ForrestLin_0-1725483838327.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2024 21:04:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-get-fields-of-dynamic-layer-hosted-by/m-p/1535300#M85604</guid>
      <dc:creator>ForrestLin</dc:creator>
      <dc:date>2024-09-04T21:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to get fields of Dynamic Layer hosted by ArcGIS Server?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-get-fields-of-dynamic-layer-hosted-by/m-p/1535329#M85605</link>
      <description>&lt;P&gt;You can create a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html" target="_self"&gt;FeatureLayer&lt;/A&gt; object from the REST endpoint URL, and get the information from its &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields" target="_self"&gt;fields&lt;/A&gt; collection after it loads:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const featureLayer = new FeatureLayer({
	url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0"
});

featureLayer.when(function() {
	featureLayer.fields.forEach(function(field) {
		console.info(field.name + " ( type: " + field.type + ", alias: " + field.alias + " )");
	});
});

featureLayer.load();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2024 22:44:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-get-fields-of-dynamic-layer-hosted-by/m-p/1535329#M85605</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2024-09-04T22:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to get fields of Dynamic Layer hosted by ArcGIS Server?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-get-fields-of-dynamic-layer-hosted-by/m-p/1535434#M85608</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/6522"&gt;@JoelBennett&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 11:46:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-get-fields-of-dynamic-layer-hosted-by/m-p/1535434#M85608</guid>
      <dc:creator>ForrestLin</dc:creator>
      <dc:date>2024-09-05T11:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to get fields of Dynamic Layer hosted by ArcGIS Server?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-get-fields-of-dynamic-layer-hosted-by/m-p/1535872#M85617</link>
      <description>&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;public&lt;/SPAN&gt; &lt;SPAN&gt;loadFields&lt;/SPAN&gt;&lt;SPAN&gt;(url: string): &lt;/SPAN&gt;&lt;SPAN&gt;Promise&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;Field[]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;const&lt;/SPAN&gt; &lt;SPAN&gt;featureLayer&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;FeatureLayer&lt;/SPAN&gt;&lt;SPAN&gt;({ &lt;/SPAN&gt;&lt;SPAN&gt;url&lt;/SPAN&gt;&lt;SPAN&gt; });&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;featureLayer&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;load&lt;/SPAN&gt;&lt;SPAN&gt;().&lt;/SPAN&gt;&lt;SPAN&gt;then&lt;/SPAN&gt;&lt;SPAN&gt;((&lt;/SPAN&gt;&lt;SPAN&gt;layer&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;FeatureLayer&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;SPAN&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;layer&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;fields&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 06 Sep 2024 12:12:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-get-fields-of-dynamic-layer-hosted-by/m-p/1535872#M85617</guid>
      <dc:creator>ForrestLin</dc:creator>
      <dc:date>2024-09-06T12:12:29Z</dc:date>
    </item>
  </channel>
</rss>

