Hello,
I created a custom geoprocessing tool in Pro using a python script & tested it (of course) which works perfectly when I launch the script from ArcGIS
I published this tool so I can use it using the REST API
The issue I'm facing is when I launch the GP TOOL from the REST API the URL that I set in the script is switched to a path :
LAYER_URL = r"https://gisdata.xyzxy/arcgis/rest/services/ServiceA/FeatureServer/0"
arcpy.AddMessage(f"Layer URL: {LAYER_URL}")
This is what I get in the job Messages
For some reason the URL is switched to a path and therefore I get an error when I want to access to the feature layer
feature_layer = FeatureLayer(featureLayerUrl, gis)
Do you know why is this happening ? And how can I force the script to keep the URL that I provided ?
Thank You !
Have you tried a FeatureSet?
feature_set = arcpy.FeatureSet()
feature_set.load("url.../FeatureServer/0")