<?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 How to  get unique values from  an only field and display in a listbox in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-get-unique-values-from-an-only-field-and/m-p/382389#M35469</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to&amp;nbsp; get unique values from&amp;nbsp; an only field from a&amp;nbsp; service and after displaying field values in a listbox.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here (&lt;SPAN style="line-height: 1.5;"&gt;&lt;A class="jive-link-external-small" href="http://forums.esri.com/Thread.asp?c=158&amp;amp;f=2396&amp;amp;t=277241#top" rel="nofollow" target="_blank"&gt;http://forums.esri.com/Thread.asp?c=158&amp;amp;f=2396&amp;amp;t=277241#top&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt; )there is an example that shows several fields in a first listbox, and after shows the fields values in a second listboxs&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt; How could i do the same but with an only FIELD instead of an array of field.&amp;nbsp; I only need to display the values of an only field in a listbox.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Anyone could help??? Any idea about how to subsitute ana array of fields per an single field in this code html??&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Thank you very much. I am not developer and this is quite difficult for me&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.w3.org/TR/html4/strict.dtd" rel="nofollow" target="_blank"&gt;http://www.w3.org/TR/html4/strict.dtd&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;html lang="en"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;head&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;title&amp;gt;requestfieldvalues&amp;lt;/title&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;script type="text/javascript" src="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=1.3" rel="nofollow" target="_blank"&gt;http://serverapi.arcgisonline.com/jsapi/arcgis/?v=1.3&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;script type="text/javascript" charset="utf-8"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; dojo.require("esri.utils");&lt;/P&gt;&lt;P&gt;&amp;nbsp; dojo.require("esri.tasks.query");&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; var queryTask, query;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; function init() {&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; queryTask = new esri.tasks.QueryTask("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/2" rel="nofollow" target="_blank"&gt;http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/2&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; query = new esri.tasks.Query();&lt;/P&gt;&lt;P&gt;&amp;nbsp; query.where = "1=1";&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; getFieldList();&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; dojo.addOnLoad(init);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; function getFieldList() {&lt;/P&gt;&lt;P&gt;&amp;nbsp; esri.request({&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; url: "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0" rel="nofollow" target="_blank"&gt;http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0&lt;/A&gt;&lt;SPAN&gt;",&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; content: { f:"json" },&lt;/P&gt;&lt;P&gt;&amp;nbsp; handleAs: "json",&lt;/P&gt;&lt;P&gt;&amp;nbsp; callbackParamName: "callback",&lt;/P&gt;&lt;P&gt;&amp;nbsp; load: function(response, io) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; var fields = response.fields;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var options = [];&lt;/P&gt;&lt;P&gt;&amp;nbsp; dojo.forEach(fields, function(field) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; options.push("&amp;lt;option value=\"" + field.name + "\"&amp;gt;" + field.alias + "&amp;lt;/option&amp;gt;");&lt;/P&gt;&lt;P&gt;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&amp;nbsp; dojo.byId("fields").innerHTML = options.join("");&lt;/P&gt;&lt;P&gt;&amp;nbsp; },&lt;/P&gt;&lt;P&gt;&amp;nbsp; error: function(error) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; alert(error.message);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; function getFieldValues(field) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; query.outFields = [field];&lt;/P&gt;&lt;P&gt;&amp;nbsp; queryTask.execute(query, dojo.partial(displayValues, field));&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; function displayValues(field, featureSet) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; var options = [], values = [], value;&lt;/P&gt;&lt;P&gt;&amp;nbsp; dojo.forEach(featureSet.features, function(feature) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; value = feature.attributes[field];&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; //add all values&lt;/P&gt;&lt;P&gt;&amp;nbsp; // options.push("&amp;lt;option value=\"" + value + "&amp;gt;" + value + "&amp;lt;/option&amp;gt;");&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; //filter values to only display unique values&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (dojo.indexOf(values, value) == -1) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; values.push(value);&lt;/P&gt;&lt;P&gt;&amp;nbsp; options.push("&amp;lt;option value=\"" + value + "\"&amp;gt;" + value + "&amp;lt;/option&amp;gt;");&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; dojo.byId("values").innerHTML = options.join("");&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;/head&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;body&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;select id="fields" onchange="getFieldValues(this.value);"&amp;gt;&amp;lt;/select&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;select id="values" onchange="getFieldValues(this.value);"&amp;gt;&amp;lt;/select&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;/body&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/html&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Jun 2015 10:24:42 GMT</pubDate>
    <dc:creator>DavidDíez</dc:creator>
    <dc:date>2015-06-17T10:24:42Z</dc:date>
    <item>
      <title>How to  get unique values from  an only field and display in a listbox</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-get-unique-values-from-an-only-field-and/m-p/382389#M35469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to&amp;nbsp; get unique values from&amp;nbsp; an only field from a&amp;nbsp; service and after displaying field values in a listbox.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here (&lt;SPAN style="line-height: 1.5;"&gt;&lt;A class="jive-link-external-small" href="http://forums.esri.com/Thread.asp?c=158&amp;amp;f=2396&amp;amp;t=277241#top" rel="nofollow" target="_blank"&gt;http://forums.esri.com/Thread.asp?c=158&amp;amp;f=2396&amp;amp;t=277241#top&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt; )there is an example that shows several fields in a first listbox, and after shows the fields values in a second listboxs&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt; How could i do the same but with an only FIELD instead of an array of field.&amp;nbsp; I only need to display the values of an only field in a listbox.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Anyone could help??? Any idea about how to subsitute ana array of fields per an single field in this code html??&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Thank you very much. I am not developer and this is quite difficult for me&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.w3.org/TR/html4/strict.dtd" rel="nofollow" target="_blank"&gt;http://www.w3.org/TR/html4/strict.dtd&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;html lang="en"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;head&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;title&amp;gt;requestfieldvalues&amp;lt;/title&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;script type="text/javascript" src="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=1.3" rel="nofollow" target="_blank"&gt;http://serverapi.arcgisonline.com/jsapi/arcgis/?v=1.3&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;script type="text/javascript" charset="utf-8"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; dojo.require("esri.utils");&lt;/P&gt;&lt;P&gt;&amp;nbsp; dojo.require("esri.tasks.query");&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; var queryTask, query;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; function init() {&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; queryTask = new esri.tasks.QueryTask("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/2" rel="nofollow" target="_blank"&gt;http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/2&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; query = new esri.tasks.Query();&lt;/P&gt;&lt;P&gt;&amp;nbsp; query.where = "1=1";&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; getFieldList();&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; dojo.addOnLoad(init);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; function getFieldList() {&lt;/P&gt;&lt;P&gt;&amp;nbsp; esri.request({&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; url: "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0" rel="nofollow" target="_blank"&gt;http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0&lt;/A&gt;&lt;SPAN&gt;",&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; content: { f:"json" },&lt;/P&gt;&lt;P&gt;&amp;nbsp; handleAs: "json",&lt;/P&gt;&lt;P&gt;&amp;nbsp; callbackParamName: "callback",&lt;/P&gt;&lt;P&gt;&amp;nbsp; load: function(response, io) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; var fields = response.fields;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var options = [];&lt;/P&gt;&lt;P&gt;&amp;nbsp; dojo.forEach(fields, function(field) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; options.push("&amp;lt;option value=\"" + field.name + "\"&amp;gt;" + field.alias + "&amp;lt;/option&amp;gt;");&lt;/P&gt;&lt;P&gt;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&amp;nbsp; dojo.byId("fields").innerHTML = options.join("");&lt;/P&gt;&lt;P&gt;&amp;nbsp; },&lt;/P&gt;&lt;P&gt;&amp;nbsp; error: function(error) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; alert(error.message);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; function getFieldValues(field) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; query.outFields = [field];&lt;/P&gt;&lt;P&gt;&amp;nbsp; queryTask.execute(query, dojo.partial(displayValues, field));&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; function displayValues(field, featureSet) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; var options = [], values = [], value;&lt;/P&gt;&lt;P&gt;&amp;nbsp; dojo.forEach(featureSet.features, function(feature) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; value = feature.attributes[field];&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; //add all values&lt;/P&gt;&lt;P&gt;&amp;nbsp; // options.push("&amp;lt;option value=\"" + value + "&amp;gt;" + value + "&amp;lt;/option&amp;gt;");&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; //filter values to only display unique values&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (dojo.indexOf(values, value) == -1) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; values.push(value);&lt;/P&gt;&lt;P&gt;&amp;nbsp; options.push("&amp;lt;option value=\"" + value + "\"&amp;gt;" + value + "&amp;lt;/option&amp;gt;");&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; dojo.byId("values").innerHTML = options.join("");&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;/head&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;body&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;select id="fields" onchange="getFieldValues(this.value);"&amp;gt;&amp;lt;/select&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;select id="values" onchange="getFieldValues(this.value);"&amp;gt;&amp;lt;/select&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;/body&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/html&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jun 2015 10:24:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-get-unique-values-from-an-only-field-and/m-p/382389#M35469</guid>
      <dc:creator>DavidDíez</dc:creator>
      <dc:date>2015-06-17T10:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to  get unique values from  an only field and display in a listbox</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-get-unique-values-from-an-only-field-and/m-p/382390#M35470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/146826" target="_blank"&gt;David Díez&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can eliminate the returned fields from the&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;query&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;outFields &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #dd1144;"&gt;"ID"&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;];&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check it from &lt;A href="https://developers.arcgis.com/javascript/jsapi/query-amd.html" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or simply you can add if statement..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; dojo.forEach(fields, function(field) {
if (field.name === "ID")
&amp;nbsp; options.push("&amp;lt;option value=\"" + field.name + "\"&amp;gt;" + field.alias + "&amp;lt;/option&amp;gt;");
&amp;nbsp; });&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, simply you can get the unique values from the returned array&amp;nbsp; from &lt;A href="http://stackoverflow.com/questions/11246758/how-to-get-unique-values-in-an-array" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this help you, if you find the answer please mark it as Correct Answer from Actions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Yusuf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:37:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-get-unique-values-from-an-only-field-and/m-p/382390#M35470</guid>
      <dc:creator>YousefQuran</dc:creator>
      <dc:date>2021-12-11T17:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to  get unique values from  an only field and display in a listbox</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-get-unique-values-from-an-only-field-and/m-p/382391#M35471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much for your help .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 06:11:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-get-unique-values-from-an-only-field-and/m-p/382391#M35471</guid>
      <dc:creator>DavidDíez</dc:creator>
      <dc:date>2015-06-22T06:11:22Z</dc:date>
    </item>
  </channel>
</rss>

