<?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: Get  the ID of graphics on featureLayer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-the-id-of-graphics-on-featurelayer/m-p/1106905#M74946</link>
    <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous User&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Please refer to this sample this will provide you some reference to get the attributes for the clicked feature on the map.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/view-hittest/" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/view-hittest/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What you have in your code snippet, will return object only, you will need to further modify the code to get attributes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Oct 2021 23:35:21 GMT</pubDate>
    <dc:creator>ManishPatel</dc:creator>
    <dc:date>2021-10-12T23:35:21Z</dc:date>
    <item>
      <title>Get  the ID of graphics on featureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-the-id-of-graphics-on-featurelayer/m-p/1106897#M74945</link>
      <description>&lt;P&gt;I have a feature layer that is not preselected on map load and I want to get the ID of a point on the map when I click on it, on a certain point. Further on, I'll get that ID and send it to a backend method for further data processing.&lt;/P&gt;&lt;P&gt;My question is how do I get the ID of a point on the map when I click on it? How do I always get the ID with each new click on a different point?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NovicaJ_0-1634080078789.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/25052iDECE0EA7A87E0693/image-size/medium?v=v2&amp;amp;px=400" role="button" title="NovicaJ_0-1634080078789.png" alt="NovicaJ_0-1634080078789.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;First click on 2, get the ID. Then click on 1, get the ID, etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried something like this&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;disLayer = new FeatureLayer({
    title: restService.label,
    url: restService.restServiceLink,
    outFields: ["*"], // Return all fields so it can be queried client-side
    popupTemplate: {  // Enable a popup
                        title: "&amp;lt;b&amp;gt;" + restService.label + ": {" + restService.searchAndPopupFieldName + "} &amp;lt;/b&amp;gt;",
                        content: photoContentHtml
                    }
    });

map.add(disLayer, 0);
on(disLayer, 'click', function (e) {
   console.log("e", e);
});&lt;/LI-CODE&gt;&lt;P&gt;I wanted to see what 'e' contains, but I can't print it out. The on click event doesn't work and it's not printing e. How do I get the ID of a point on map when I click the point?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 23:12:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-the-id-of-graphics-on-featurelayer/m-p/1106897#M74945</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-10-12T23:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: Get  the ID of graphics on featureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-the-id-of-graphics-on-featurelayer/m-p/1106905#M74946</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous User&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Please refer to this sample this will provide you some reference to get the attributes for the clicked feature on the map.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/view-hittest/" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/view-hittest/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What you have in your code snippet, will return object only, you will need to further modify the code to get attributes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 23:35:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-the-id-of-graphics-on-featurelayer/m-p/1106905#M74946</guid>
      <dc:creator>ManishPatel</dc:creator>
      <dc:date>2021-10-12T23:35:21Z</dc:date>
    </item>
  </channel>
</rss>

