<?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 case sensitive attribute name in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/case-sensitive-attribute-name/m-p/425858#M39145</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there any way to fetch attribute value using case insensitive attribute name? e.g. Following example is using objectIdField in the code. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="https://developers.arcgis.com/javascript/jssamples/query_buffer.html" rel="nofollow" target="_blank"&gt;Select with Feature Layer | ArcGIS API for JavaScript&lt;/A&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;inBuffer.push(feature.attributes[featureLayer.objectIdField]);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure, how objectIdField is configured here but similar way, if I want to access any other field in the attributes regardless of the case then how can I do that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Aug 2014 15:01:30 GMT</pubDate>
    <dc:creator>BhavinSanghani</dc:creator>
    <dc:date>2014-08-04T15:01:30Z</dc:date>
    <item>
      <title>case sensitive attribute name</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/case-sensitive-attribute-name/m-p/425858#M39145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there any way to fetch attribute value using case insensitive attribute name? e.g. Following example is using objectIdField in the code. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="https://developers.arcgis.com/javascript/jssamples/query_buffer.html" rel="nofollow" target="_blank"&gt;Select with Feature Layer | ArcGIS API for JavaScript&lt;/A&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;inBuffer.push(feature.attributes[featureLayer.objectIdField]);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure, how objectIdField is configured here but similar way, if I want to access any other field in the attributes regardless of the case then how can I do that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 15:01:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/case-sensitive-attribute-name/m-p/425858#M39145</guid>
      <dc:creator>BhavinSanghani</dc:creator>
      <dc:date>2014-08-04T15:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: case sensitive attribute name</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/case-sensitive-attribute-name/m-p/425859#M39146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bhavin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The case sensitivity will depend on the underlying database, for example if you are using a SQLServer database then the SQL statement is not case sensitive yet a file geodatabase is. What you can use is the upper or lower commands to match the case you require, eg:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/0/query?where=created_user+%3D+upper%28%27user1%27%29&amp;amp;objectIds=&amp;amp;time=&amp;amp;geometry=&amp;amp;geometryType=esriGeometryEnvelope&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;relationParam=&amp;amp;outFields=*&amp;amp;returnGeometry=true&amp;amp;maxAllowableOffset=&amp;amp;geometryPrecision=&amp;amp;outSR=&amp;amp;gdbVersion=&amp;amp;returnDistinctValues=false&amp;amp;returnIdsOnly=false&amp;amp;returnCountOnly=false&amp;amp;orderByFields=&amp;amp;groupByFieldsForStatistics=&amp;amp;outStatistics=&amp;amp;returnZ=false&amp;amp;returnM=false&amp;amp;f=html" title="http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/0/query?where=created_user+%3D+upper%28%27user1%27%29&amp;amp;objectIds=&amp;amp;time=&amp;amp;geometry=&amp;amp;geometryType=esriGeometryEnvelope&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;relationParam=&amp;amp;outFields=*&amp;amp;returnGeometry=true&amp;amp;maxAllowableOffset=&amp;amp;geometryPrecision=&amp;amp;outSR=&amp;amp;gdbVersion=&amp;amp;returnDistinctValues=false&amp;amp;returnIdsOnly=false&amp;amp;returnCountOnly=false&amp;amp;orderByFields=&amp;amp;groupByFieldsForStatistics=&amp;amp;outStatistics=&amp;amp;returnZ=false&amp;amp;returnM=false&amp;amp;f=html"&gt;Query: Wildfire Response Points (ID: 0)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice if you remove the upper command no results are returned&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anthony‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 15:34:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/case-sensitive-attribute-name/m-p/425859#M39146</guid>
      <dc:creator>AnthonyGiles</dc:creator>
      <dc:date>2014-08-04T15:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: case sensitive attribute name</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/case-sensitive-attribute-name/m-p/425860#M39147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your example, upper is used with the attribute value. Did you intend to use it with the attribute name? My question is about attribute name mainly since that is used to fetch attribute value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking for following scenarios:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;feature.attributes.created_user - this will return value in this case&lt;/P&gt;&lt;P&gt;feature.attributes.CREATED_USER - this won't return value in this case because CREATED_USER attribute is not existed. But created_user is existed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way to configure particular field name constant (as given in following example) so, that can be referred with attributes while fetching attribute values? How objectIdField is configured here, any idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;A class="jive-link-external-small" href="https://developers.arcgis.com/javascript/jssamples/query_buffer.html" rel="nofollow" style="font-style: inherit; font-family: inherit; color: #287433;" target="_blank"&gt;Select with Feature Layer | ArcGIS API for JavaScript&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;inBuffer.push(feature.attributes[featureLayer.objectIdField]);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 17:31:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/case-sensitive-attribute-name/m-p/425860#M39147</guid>
      <dc:creator>BhavinSanghani</dc:creator>
      <dc:date>2014-08-04T17:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: case sensitive attribute name</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/case-sensitive-attribute-name/m-p/425861#M39148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the objectIdField is a property of the feature layer which is automatically set to t&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;he name of the field that contains the Object ID field for the layer. You will notice that there is not actually any field in the service that is called objectIdField. It is used to uniquely reference each feature in the layer.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 21:26:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/case-sensitive-attribute-name/m-p/425861#M39148</guid>
      <dc:creator>AnthonyGiles</dc:creator>
      <dc:date>2014-08-04T21:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: case sensitive attribute name</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/case-sensitive-attribute-name/m-p/425862#M39149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bhavin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'll need another function which will do a case insensitive check on field name and return case sensitive field name which you can use to access the value. Refer below highlighted code changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;function getCaseSensitiveAttributeName(fieldAliases, fieldName){&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; for (var key in fieldAliases) {&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; if (key.toUpperCase() === fieldName.toUpperCase()){&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; return key;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; }&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; }&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; return "";&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function selectInBuffer(response){&lt;/P&gt;&lt;P&gt;&amp;nbsp; var feature;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var features = response.features;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var inBuffer = [];&lt;/P&gt;&lt;P&gt;&amp;nbsp; //filter out features that are not actually in buffer, since we got all points in the buffer's bounding box&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; var mySensitiveField = getCaseSensitiveAttributeName(response.fieldAliases, &amp;lt;&amp;lt;Your Field Name&amp;gt;&amp;gt;);&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; for (var i = 0; i &amp;lt; features.length; i++) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; feature = features&lt;I&gt;;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(circle.contains(feature.geometry)){&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; inBuffer.push(feature.attributes[mySensitiveField]);&lt;/STRONG&gt;&lt;/EM&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; var query = new Query();&lt;/P&gt;&lt;P&gt;&amp;nbsp; query.objectIds = inBuffer;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //use a fast objectIds selection query (should not need to go to the server)&lt;/P&gt;&lt;P&gt;&amp;nbsp; featureLayer.selectFeatures(query, FeatureLayer.SELECTION_NEW, function(results){&lt;/P&gt;&lt;P&gt;&amp;nbsp; var totalPopulation = sumPopulation(results);&lt;/P&gt;&lt;P&gt;&amp;nbsp; var r = "";&lt;/P&gt;&lt;P&gt;&amp;nbsp; r = "&amp;lt;b&amp;gt;The total Census Block population within the buffer is &amp;lt;i&amp;gt;" + totalPopulation + "&amp;lt;/i&amp;gt;.&amp;lt;/b&amp;gt;";&lt;/P&gt;&lt;P&gt;&amp;nbsp; dom.byId("messages").innerHTML = r;&lt;/P&gt;&lt;P&gt;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2014 02:16:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/case-sensitive-attribute-name/m-p/425862#M39149</guid>
      <dc:creator>RiyasDeen</dc:creator>
      <dc:date>2014-08-05T02:16:19Z</dc:date>
    </item>
  </channel>
</rss>

