<?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: Getting Field Values of Specific Layer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-field-values-of-specific-layer/m-p/389234#M35916</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Your code accesses the map layer. To access field values you need to query features - not the layer properties.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The first thing you will need to do is query the layer for the features that you want, check out:&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;QueryTask: &lt;A href="https://developers.arcgis.com/javascript/jsapi/querytask-amd.html"&gt;https://developers.arcgis.com/javascript/jsapi/querytask-amd.html&lt;/A&gt;&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Query: &lt;A href="https://developers.arcgis.com/javascript/jsapi/query-amd.html"&gt;https://developers.arcgis.com/javascript/jsapi/query-amd.html&lt;/A&gt;&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;BR /&gt;&lt;SPAN&gt;Set the where clause on the Query to select your features ("TID" &amp;gt; 0 or "TID" = 0) then process your features in the response handling function.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 28 Jun 2014 07:50:23 GMT</pubDate>
    <dc:creator>OwenEarley</dc:creator>
    <dc:date>2014-06-28T07:50:23Z</dc:date>
    <item>
      <title>Getting Field Values of Specific Layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-field-values-of-specific-layer/m-p/389233#M35915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've been trying to read through the ArcGIS JavaScript API but can't find what I want.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a web map on my page that is based on my my map stored on ArcGIS online.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to create an if/else statement that does different things based on the value of a field in the layer. But I'm having a hard time accessing the field of the layer I want. Here is part of the JavaScript in my HTML code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var exLayer = actualmap.getLayer(actualmap.layerIds[6]).layerInfos[0];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(exLayer);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With the code above, I am able to access the layer I want in my web map. The web service I want is number 6 on the AGOL map, and the layer I want on this web service is number 0. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to access the field in layer 0 called "TID", and I want to get the rows with "TID" &amp;gt; 0 and rows "TID" = 0 for my if/else statement. I tried the below to access field names, but it didn't work. It just gave me the layer name. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var test1 = Field(exLayer).name;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(test1);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2014 18:43:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-field-values-of-specific-layer/m-p/389233#M35915</guid>
      <dc:creator>LisCollins</dc:creator>
      <dc:date>2014-06-27T18:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Field Values of Specific Layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-field-values-of-specific-layer/m-p/389234#M35916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Your code accesses the map layer. To access field values you need to query features - not the layer properties.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The first thing you will need to do is query the layer for the features that you want, check out:&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;QueryTask: &lt;A href="https://developers.arcgis.com/javascript/jsapi/querytask-amd.html"&gt;https://developers.arcgis.com/javascript/jsapi/querytask-amd.html&lt;/A&gt;&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Query: &lt;A href="https://developers.arcgis.com/javascript/jsapi/query-amd.html"&gt;https://developers.arcgis.com/javascript/jsapi/query-amd.html&lt;/A&gt;&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;BR /&gt;&lt;SPAN&gt;Set the where clause on the Query to select your features ("TID" &amp;gt; 0 or "TID" = 0) then process your features in the response handling function.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2014 07:50:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-field-values-of-specific-layer/m-p/389234#M35916</guid>
      <dc:creator>OwenEarley</dc:creator>
      <dc:date>2014-06-28T07:50:23Z</dc:date>
    </item>
  </channel>
</rss>

