Select to view content in your preferred language

Referencing Features, and Trace, in ArcPy for use in Web AppBuilder

812
2
12-20-2016 04:18 PM
EddyClark
Frequent Contributor

Hi All- n00b here.

I have a python script that works in ArcMap.  It traces a geometric network, references feature classes (flags/barriers), tables for calculations, etc.  

I'm wondering how to reference these things (feature classes, tables, etc) in the python script so that I can use in AGOL?

Here are some code snippets.  As you can see I'm referencing data on SDE.  My guess is I need to reference the REST URL?  i.e. server/name/rest/services/webapp/geometricnetwork/MapServer

  1. ElecGeomNetwork = "C:\\blahblahblah\\asdf.sde\\asdf.GDBO.ElectricDataset\\asdf.GDBO.ElectricGeom_Net"
  2. ElecGeomNetwork__2_ = "ElecGeomNetwork"
  3. ServicePoint = "ServiceLocation"
  4. Table = "asdf.GDBO.TableTest"
  5. Transformer = "Transformer Bank"
  6. arcpy.TraceGeometricNetwork_management(ElecGeomNetwork, ElecGeomNetwork__2_, Transformer, "FIND_CONNECTED", "", "", "", "", "asdf.GDBO.PrimaryOHLineSection;asdf.GDBO.PrimaryUGLineSection", "NO_TRACE_ENDS", "NO_TRACE_INDETERMINATE_FLOW", "", "", "AS_IS", "", "", "", "AS_IS")
0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus

Eddy,

   You would run the model and then from the results tab in ArcMap publish a GPService from that then you would have a rest url to the GP Service that you could use in the GP Widget.

DerekLaw
Esri Esteemed Contributor

Hi Eddy,

Just to add onto Robert's reply, please review this help doc

A quick tour of authoring and sharing geoprocessing services—Documentation | ArcGIS Enterprise 

Hope this helps,

0 Kudos