IBM Support

While Doing Queries Using Map Services, Use JSON Instead of PJSON

Flashes (Alerts)


Abstract

If using PJSON, it is possible that data returned from the query is not formatted correctly.

Content

The PJSON format is known as "prettified" JSON, and it formats the spaces, tabs and carriage returns to improve human readability. Characters such as "\\" might be picked up as escape characters, and as a result - may concatenate data unexpectedly, or do other strange behaviors

To stop this from happening, you should use the JSON format (note the changes in bold)

An example of a URL with PJSON:
http://ArcGISforServerURL:port/arcgis/rest/services/Water_Network/FeatureServer/15/query?where=mxcreationstate=1&outFields=*&f=pjson

An example of a URL with JSON:
http://ArcGISforServerURL:port/arcgis/rest/services/Water_Network/FeatureServer/15/query?where=mxcreationstate=1&outFields=*&f=json

[{"Product":{"code":"SSG2D3","label":"Maximo Spatial Asset Management"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Not Applicable","Platform":[{"code":"PF033","label":"Windows"}],"Version":"7.6;7.6.0.1;7.6.0.2","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Document Information

Modified date:
25 September 2022

UID

swg22010521