I created a custom geoprocessing tool using Python in ArcGIS Pro and published it to use in Web AppBuilder. The results show with no issues in ArcGIS Pro, however, in Web AppBuilder, they don't, I believe the issue has to do with not specifying the output parameter correctly.
My issue now is how would I specify the output parameter to be the same as the input parameter? I added the arcpy.env.overwriteOutput = True and I did set the output parameter to be derived. But when I run the tool, it doesn't give me any errors and it tells me that the results are drawn on the map, but the changes are not implemented.
Not too sure what I'm doing wrong.
Here's my Python script:
arcpy.env.overwriteOutput = True
#Inputs
Point1 = arcpy.GetParameterAsText(0)
Point2 = arcpy.GetParameterAsText(1)
Polygon = arcpy.GetParameterAsText(2)
#Outputs
out1 = arcpy.SetParameter(3, Point1)
out2 = arcpy.SetParameter(4, Point2)
# Select points that overlap the polygon
selected_points = arcpy.SelectLayerByLocation_management(Point1, 'INTERSECT',
Polygon)
#Append selected points to the other layer.
arcpy.Append_management(selected_points, Point2, 'NO_TEST')
#Deelete selected points from the original layer
arcpy.DeleteFeatures_management(selected_points)