Select to view content in your preferred language

How do I delete/break relationships between entities

03-29-2019 10:52 AM
New Contributor

I created relationships between layers in a feature service in AGOL using the ArcGIS API for Python using the add_to_definition method:


However, I can not see to delete the relationship.  I have tried using the update relationship and passing in an empty list, which give a {'success': True}

but the relationships persist.   I have tried using delete_from_definition where I pass in the entire relationship list of dictionaries which gave me: 

Unable to delete feature service layer definition. 'REL_FK_MINING_AND_HAZARDS_20190225_GDB_POINT_MINING_FEATURE_0' is not a constraint. Could not drop constraint. See previous errors.

I can't find anywhere to drop constraints by name.  Anyone else know how to do this?  Has to be a scripted solution.

0 Kudos
1 Reply
New Contributor III

Use the python's requests module to send an HTTPS Post request as suggested in the documentation below:

Delete From Definition (Feature Layer)—ArcGIS REST API: Services Directory | ArcGIS for Developers 

Refer the: Example 1: Delete fields from the feature service layer


0 Kudos