<?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: Feature Layer QueryIds -- What id is returned? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-queryids-what-id-is-returned/m-p/636782#M59511</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again.&amp;nbsp; Yes the definition expression should work perfectly.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Apr 2015 21:32:50 GMT</pubDate>
    <dc:creator>DanRicketts</dc:creator>
    <dc:date>2015-04-22T21:32:50Z</dc:date>
    <item>
      <title>Feature Layer QueryIds -- What id is returned?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-queryids-what-id-is-returned/m-p/636778#M59507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a feature Layer and am running queryids.&amp;nbsp; I get the array of ids fine.&amp;nbsp; However, I can't figure out where the id is coming from.&amp;nbsp; The documentation says it is the "ObjectId."&amp;nbsp; When I look at the feature service list of fields ObjectID is one of the fields listed but it doesn't seem to be a field that is returned to the browser, I am doing "*" as my fields so I should be getting all.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought maybe the objectid was the array object number but I can't find any correlation between the ID from the feature service to the array object # in the browser.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I access this Object ID in the feature layer in browser?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to loop through my graphics in the feature layer and show the graphics that are in my ID array.&amp;nbsp; Don't know what Id that query returned.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 20:20:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-queryids-what-id-is-returned/m-p/636778#M59507</guid>
      <dc:creator>DanRicketts</dc:creator>
      <dc:date>2015-04-20T20:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Layer QueryIds -- What id is returned?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-queryids-what-id-is-returned/m-p/636779#M59508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The returned id is the value for the object id field for the feature layer. You can find out the name of the field using the Feature Layer's &lt;A href="https://developers.arcgis.com/javascript/jsapi/featurelayer-amd.html#objectidfield"&gt;objectIdField&lt;/A&gt; property.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to show the selected features it might be simpler just to use the Feature Layer's selectFeatures method. Using this method you define a query and the features that meet the input query requirements will be displayed on the map using the selection symbol defined using the &lt;A href="https://developers.arcgis.com/javascript/jsapi/featurelayer-amd.html#setselectionsymbol"&gt;setSelectionSymbol&lt;/A&gt; method. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 22:41:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-queryids-what-id-is-returned/m-p/636779#M59508</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2015-04-20T22:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Layer QueryIds -- What id is returned?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-queryids-what-id-is-returned/m-p/636780#M59509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kelly thanks for pointing out the objectIdField property.&amp;nbsp; This answered the question.&amp;nbsp; It returned ESRI_OID.&amp;nbsp; This apparently is a field desktop adds when you import the layer which complicates the matter because it is not in my original SQL dataset so I can't query the database to verify results and my query is returning incorrect results both when run in javascript and when I run directly on the service within arcgis server.&amp;nbsp; I am trying to find out where this ESRI_OID is stored but not having any luck.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am in fact using the ids to determine the visible points per layer.&amp;nbsp; I am doing a variety of query's to provide an array of ids that meet the requirements.&amp;nbsp; It looks like the selectFeatures method only highlights the features, since I already have a class breaks renderer defined with a symbol for the layer.&amp;nbsp; It doesn't hide the points in the layer that don't meet criteria, at least that I can see.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 22:13:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-queryids-what-id-is-returned/m-p/636780#M59509</guid>
      <dc:creator>DanRicketts</dc:creator>
      <dc:date>2015-04-21T22:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Layer QueryIds -- What id is returned?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-queryids-what-id-is-returned/m-p/636781#M59510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/27356"&gt;Dan Ricketts&lt;/A&gt;​&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A layer definition will filter the layer to only display the features that match the definition expression.&amp;nbsp; Here's a JSBin that shows how to generate a definition expression based on the results of&amp;nbsp; queryIds. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://jsbin.com/comorolovu/1/" title="http://jsbin.com/comorolovu/1/"&gt;Create a Map&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 22:48:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-queryids-what-id-is-returned/m-p/636781#M59510</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2015-04-21T22:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Layer QueryIds -- What id is returned?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-queryids-what-id-is-returned/m-p/636782#M59511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again.&amp;nbsp; Yes the definition expression should work perfectly.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2015 21:32:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-queryids-what-id-is-returned/m-p/636782#M59511</guid>
      <dc:creator>DanRicketts</dc:creator>
      <dc:date>2015-04-22T21:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Layer QueryIds -- What id is returned?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-queryids-what-id-is-returned/m-p/636783#M59512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kelly,&lt;/P&gt;&lt;P&gt;Is there a good way to force a query on the entire layer instead of only what was in the definition?&amp;nbsp; I set the definition based on the selection.&amp;nbsp; However, if the user changes their selection it only queries the existing definition.&amp;nbsp; I understand that is by design.&amp;nbsp; If I clear it by setting definition to empty then it doesn't finish in time.&amp;nbsp; I can set a promise I supposed and wait but wanted to see if there was some way to force a query on the layer instead of just the current definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought of going back to hiding the non-selected graphics but it seems to leave them in the selection area.&amp;nbsp; So if a point is around a hidden graphic when you select the visible graphic the hidden is also available.&amp;nbsp; Apparently hiding the graphic doesn't prevent the popups from using it when selecting in the area.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 13:18:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-queryids-what-id-is-returned/m-p/636783#M59512</guid>
      <dc:creator>DanRicketts</dc:creator>
      <dc:date>2015-04-28T13:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Layer QueryIds -- What id is returned?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-queryids-what-id-is-returned/m-p/636784#M59513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can wait until the current expression is cleared before applying the new one. Here's an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;nbsp; &amp;lt;title&amp;gt;QueryMap&amp;lt;/title&amp;gt;
&amp;nbsp; &amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&amp;gt;
&amp;nbsp; &amp;lt;meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"&amp;gt;
&lt;SPAN&gt;&amp;nbsp; &amp;lt;link rel="stylesheet" href="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://js.arcgis.com/3.13/dijit/themes/claro/claro.css" rel="nofollow noopener noreferrer" target="_blank"&gt;http://js.arcgis.com/3.13/dijit/themes/claro/claro.css&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&lt;/SPAN&gt;
&lt;SPAN&gt;&amp;nbsp; &amp;lt;link rel="stylesheet" href="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://js.arcgis.com/3.13/esri/css/esri.css" rel="nofollow noopener noreferrer" target="_blank"&gt;http://js.arcgis.com/3.13/esri/css/esri.css&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&lt;/SPAN&gt;
&amp;nbsp; &amp;lt;style&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; html, body, #mapDiv{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; padding: 0;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; margin: 0;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; height: 100%;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; #clearButton{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; z-index: 40;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; position: absolute;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; top:5px;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; right:10px;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; &amp;lt;/style&amp;gt;
&amp;nbsp; 
&lt;SPAN&gt;&amp;nbsp; &amp;lt;script src="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://js.arcgis.com/3.13/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://js.arcgis.com/3.13/&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;
&amp;nbsp; &amp;lt;script&amp;gt;


&amp;nbsp;&amp;nbsp;&amp;nbsp; require(["esri/map", "esri/layers/FeatureLayer", "esri/tasks/query", "esri/InfoTemplate", "dojo/on","dojo/dom", "dojo/domReady!"], function(Map, FeatureLayer, Query, InfoTemplate, on, dom) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var map = new Map("mapDiv", {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; center: [-118.29, 34.07],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zoom: 13,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; basemap: "gray"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Clear the existing expression and once the layer is updated apply
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //the new expression
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on(dom.byId("clearButton"),"click",function(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on.once(flayer, "update-start", function(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateQuery(flayer, "Ligustrum lucidum"); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flayer.setDefinitionExpression(null);


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var flayer = new FeatureLayer("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/ParkTrees/FeatureServer/0" rel="nofollow noopener noreferrer" target="_blank"&gt;http://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/ParkTrees/FeatureServer/0&lt;/A&gt;&lt;SPAN&gt;",{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outFields: ["*"],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infoTemplate: new InfoTemplate("${COMMON}","${BOTANICAL}")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.addLayer(flayer);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flayer.on("load",function(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateQuery(flayer, "Fraxinus uhdei");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function updateQuery(layer, expression){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var query = new Query();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.where = "BOTANICAL = '" + expression +&amp;nbsp; "'";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layer.queryIds(query, function(objectIds) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var exp = layer.objectIdField + " IN(" + objectIds.join(",") + ")";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layer.setDefinitionExpression(exp);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }


&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp; &amp;lt;/script&amp;gt;


&amp;lt;/head&amp;gt;
&amp;lt;body class="claro"&amp;gt;
&amp;nbsp; &amp;lt;div id="mapDiv"&amp;gt;&amp;lt;/div&amp;gt;
&amp;nbsp; &amp;lt;input id="clearButton" type="button" value="Clear"/&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:04:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-queryids-what-id-is-returned/m-p/636784#M59513</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2021-12-12T03:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Layer QueryIds -- What id is returned?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-queryids-what-id-is-returned/m-p/636785#M59514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kelly,&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp; Howerver, instead of update-start wouldn't you want update-end?&amp;nbsp; We would want the definitionexpression(null) to complete prior to trying to set a new defexpres correct?&amp;nbsp; Wouldn't this try to update the expression at pretty much the same time as it was being cleared?&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 20:38:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-queryids-what-id-is-returned/m-p/636785#M59514</guid>
      <dc:creator>DanRicketts</dc:creator>
      <dc:date>2015-04-28T20:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Layer QueryIds -- What id is returned?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-queryids-what-id-is-returned/m-p/636786#M59515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Either way should work because update shouldn't fire until after the layer definition is cleared. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Apr 2015 16:45:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-queryids-what-id-is-returned/m-p/636786#M59515</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2015-04-29T16:45:58Z</dc:date>
    </item>
  </channel>
</rss>

