no feature is created from a model

465
13
05-22-2020 08:06 AM
MedMZOURI
New Contributor III

Hy guys..I have created a python script and a model which creates a feature (a square) in a layer given X and Y coordinates of center. of the square...it works on Arcgis desktop so I published it as a geoprocessing service and added it as a custom widget on Web Appbuilder , and when I run it it runs without error ..But NO FEATURE is created in my layer..
I have checked everything is okay..my map is a feature layer uploaded in my arcgis server..editing is enabled , creating , deleting and deleting are enabled too..So where is the error??

Tags (2)
0 Kudos
13 Replies
MichelleBrake
New Contributor III

You mentioned that it works when you run the tool in ArcMap or ArcGIS Pro. Was the tool being run from a local copy of the feature class or the feature layer/service? Is the tool set up to use the feature service that you are trying to write to and not a local copy of the data? Without seeing the script this would be the first thing I would think of causing the problem. If you can post a copy it would help to pinpoint errors. 

I would recommend posting your question to the Python community to help get more eyes on your question. This group is for the product Admin Tools by GEO Jobe. 

 

Thanks,

Michelle
geojobe.com

MedMZOURI
New Contributor III

as you see my layer is "rsrv2" and the square is created in this layer..how can I check if this layer is a copy or not?

0 Kudos
MedMZOURI
New Contributor III

as you see , the square is created in a layer called "rsrv2"..how can I check if this layer is a copy or not?

0 Kudos
MedMZOURI
New Contributor III

and my published map is a map service published in my local service (an uploaded feature layer)

0 Kudos
MichelleBrake
New Contributor III

Looking at the image you posted while I see the name of the layer I'm not seeing a full reference path like 'C:\Data\...' or 'https://www.testmaps.myorg.com/...'. It looks like you are referencing a local dataset instead of the hosted service in ArcGIS Online that you are trying to write to. I would start by trying changes there and specifying the output location for where you want it to be. 

Thanks,

Michelle

geojobe.com

MedMZOURI
New Contributor III

yes..Is it necessary to write the full layer path? because the script runs correctly in arcmap..and if I should write the full path what would be the path of an sql database (because my database is an sql enterprise database) , would it be for example "myPC\SQLEXPRESS\Mydatabase\myLAYER" ??

0 Kudos
MedMZOURI
New Contributor III

Should I have a "start editing" code in my script? like 
edit = arcpy.da.Editor("C:\Users\Maestro621\AppData\Roaming\ESRI\Desktop10.3\ArcCatalog\GeopDB.sde") 
edit.startEditing() 
edit.startOperation()  

I tried it and worked in arcmap but in web appbuilder it says "error  in the location "C:\Users\Maestro621\AppData\Roaming\ESRI\Desktop10.3\ArcCatalog\GeopDB.sde")
thanks Michelle

0 Kudos
MichelleBrake
New Contributor III

Using local paths on your machine isn't going to work in the tool in Web AppBuilder or ArcGIS Online as they are not connecting to your local machine. You need to be referencing the REST endpoint/hosted feature layer URL of the output layer in order for the tool to write to that layer. 

Thanks,

Michelle

geojobe.com

MedMZOURI
New Contributor III

Thank you Michelle, I am sorry I know I bother you with my questions but it's just the only problem remaining, I did pass all previous problems..Thank you and I will consider using the REST URL and I will let you know if that works.

0 Kudos