Hello,
I have a python script that creates a feature layer and standalone table, saves them to a file geodatabase, then adds them to a map. Next I would like to relate the feature layer to the standalone table.
If I open the project in ArcGIS Pro and run the following AddRelate command in a Jupyter window it works.
arcpy.AddRelate_management("Feature", "feature_id", "Table", "table_id", "Feature", "ONE_TO_ONE")
But if I use the same command from Spyder, I get the following error:
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Layer Name or Table View: Dataset Feature does not exist or is not supported
Failed to execute (AddRelate).
I have also tried calling AddRelate with full paths to the feature and table in the file geodatabase using os.path.join(path-to-gdb, "Feature"). In that case it doesn't throw an error, but when I open the project the feature and table have been removed from the map. If I manually add them back in from the gdb, the relate is not present.
Am I doing something wrong, or have I entered bug territory?
Thanks!