Query FeatureServer: field names are case sensitive!

2935
1
01-08-2016 06:55 AM
ChristophSpoerri
New Contributor III

Hi there,

I just run into a troubling problem, and was wondering if anybody solved it already.

When query an ArcGIS Server feature server and requesting only specific fields to be returned, the requested fields are only returned if the case of the field name matches the fields in the layer description (i.e. ../myservice/FeatureServer/0).

Any ideas on how to workaround this problem!

thanks for any help,

Chris

PS: I'm currently using the .net runtime SDK 10.2.6.

0 Kudos
1 Reply
ChrisSmith7
Frequent Contributor

Hmmm, it doesn't indicate anything about case sensitivity in the API:

ArcGIS Server REST API

Description: The list of fields to be included in the returned resultset. This list is a comma delimited list of field names. If you specify the shape field in the list of return fields, it is ignored. To request geometry, set returnGeometry to true.

You can also specify the wildcard "*" as the value of this parameter. In this case, the query results include all the field values.

Example: outFields=AREANAME,ST,POP2000

Example (wildcard usage): outFields=*

I use the JSAPI to hit rest services - I just tried a query against it and asked to return field without case sensitivity, which worked, e.g.

https://mygisserver/arcgis/rest/services/myservices/foo/MapServer/0/query?

where=&

text=&

objectIds=1,2,3,4,5,6&

time=&

geometry=&

geometryType=esriGeometryEnvelope&

inSR=&

spatialRel=esriSpatialRelIntersects&

relationParam=&

outFields=testtest&

returnGeometry=false&

maxAllowableOffset=&

geometryPrecision=&

outSR=&

returnIdsOnly=false&

returnCountOnly=false&

orderByFields=&

groupByFieldsForStatistics=&

outStatistics=&

returnZ=false&

returnM=false&

gdbVersion=&

returnDistinctValues=false&

returnTrueCurves=false&

resultOffset=&

resultRecordCount=&

f=pjson

{
"displayFieldName": "TestTest",
"fieldAliases": {
  "TestTest": "TestTest"
},
"fields": [
  {
  "name": "TestTest",
  "type": "esriFieldTypeString",
  "alias": "TestTest",
  "length": 150
  }
],
"features": [
  {
  "attributes": {
    "TestTest": "Hello"
  }
  },
  {
  "attributes": {
    "TestTest": "Foo"
  }
  },
  {
  "attributes": {
    "TestTest": "Bar"
  }
  },
  {
  "attributes": {
    "TestTest": "Biz"
  }
  },
  {
  "attributes": {
    "TestTest": "Bat"
  }
  },
  {
  "attributes": {
    "TestTest": "Hat"
  }
  }
]
}

Maybe there's a setting on the map service for case sensitivity?

0 Kudos