Select to view content in your preferred language

Join AGOL hosted feature layer to feature class

09-08-2019 11:31 AM
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""
mygis = arcgis.gis.GIS(r"", "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