FAQ: Is it possible to add relationships to a hosted feature service in ArcGIS Online?
Question
Is it possible to add relationships to a hosted feature service in ArcGIS Online?
Answer
Yes. It is possible to add relationships to a hosted feature service in ArcGIS Online. The REST API Administrative directory can add and delete relationship classes in a hosted feature service in ArcGIS Online if the related table and the feature layer exist within the same service. However, it is not recommended to edit the service through the REST endpoint because this can modify the schema of the hosted feature layer. The suggested workaround is to create a related table in ArcGIS Pro, and overwrite the hosted feature layer in ArcGIS Online.
- In ArcGIS Pro, add the existing hosted feature layer from ArcGIS Online. Refer to ArcGIS Pro: Add layers to a map or scene for instructions and more information.
- Use the Create Relationship tool to create a related table for the hosted feature layer. Refer to ArcGIS Pro: Create Relationship Class for more instructions.
- Overwrite the hosted feature service from ArcGIS Pro to ArcGIS Online. Refer to ArcGIS Pro: Overwrite a web feature layer for instructions.
Related Information
- ArcGIS Pro: View and modify relationship properties
- FAQ: Does ArcGIS Online support joins and relates?
- FAQ: Why is a related table not retained when publishing a feature class from ArcGIS Pro to ArcGIS Online?
- How To: Overwrite hosted feature services from ArcGIS Pro to ArcGIS Online using Python
- FAQ: Is it possible to add or delete related records when editing a related table in ArcGIS Online Map Viewer?
Last Published: 2/17/2022
Article ID: 000025302
Software: ArcGIS Online Current ArcGIS Pro 2.7.5, 2.7.4, 2.7.3, 2.7.2, 2.7.1, 2.7, 2.4.3, 2.4.2, 2.4.1, 2.4, 2.3.3, 2.3.2, 2.3.1, 2.3, 2.2.4, 2.2.3, 2.2.2, 2.2.1, 2.2, 2.1.3, 2.1.2, 2.1.1, 2.1, 2.0.1, 2.0