AnsweredAssumed Answered

Definition Expression not working in WebMapAsJson for print service

Question asked by ellatrue on Sep 24, 2018
Latest reply on Oct 1, 2018 by ahoque-esristaff

I'm building a custom WebMapAsJson to pass to a print service, and for whatever reason, when I add the "layerDefinition" part, I am getting a 404. If I remove the layerDefinition objects, it seems to return the printed image just fine.


 "operationalLayers": [
      {
         ...
      },
      {
         "id": "MapService",
         "title": "Field Report",
         "opacity": 1,
         "minScale": 0,
         "maxScale": 0,
         "layers": [
            {
               "name": "FieldReport", //does this need to be the layer name?
               "id": 0,
               "layerDefinition": {
                  "definitionExpression": "ReportID='[GUID]'"
               }
            },
            {
               "name": "PhotoInfo",
               "id": 1,
               "layerDefinition": {
                  "definitionExpression": "FeatureID ='[GUID]'"
               }
            }
      ],
      "url": "xxxx" //(public service)
    }

]

 

Do I need to enable something like dynamic map services, or have a certain version of arcgis server for this to work? Trying to follow the instructions here:

ExportWebMap specification—ArcGIS REST API: Services Directory | ArcGIS for Developers 

Outcomes