Join AGOL hosted feature layer to feature class

374
0
09-08-2019 11:31 AM
EdwardGlover1
New Contributor III

In attempting to join a feature class to a hosted feature layer to determine if there are features that exist in the feature class and not in the hosted feature layer (see code below), I get the following error.

ERROR 000732: Join Table: Dataset fl does not exist or is not supported
Failed to execute (AddJoin).

How can I join a hosted feature layer to a feature class?

publishedWebLayer = r"https://services1.arcgis.com/mapid/ArcGIS/rest/services/FeatureServer/1"
mygis = arcgis.gis.GIS(r"https://maps.arcgis.com", "usr", "pw")
fl = arcgis.features.FeatureLayer(publishedWebLayer, mygis)
FC = r"C:\GIS\Data.gdb\BRW3"

arcpy.MakeFeatureLayer_management(FC, "fcView")
joinField = "UID"
arcpy.AddJoin_management ("fcView", joinField, "fl", joinField, "KEEP_ALL")
arcpy.SelectLayerByAttribute_management("fcView","NEW_SELECTION",'"Incidents.OBJECTID" IS NULL')

0 Kudos
0 Replies