Frequently asked question

Is it possible to add relationships to a hosted feature service in ArcGIS Online?

Last Published: August 8, 2022

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.

  1. 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.
  2. Export the feature layer to the same geodatabase where the related table is located using the Feature Class To Feature Class tool. Refer to ArcGIS Pro: Feature Class To Feature Class for instructions.
  3. 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.
  4. Overwrite the hosted feature service from ArcGIS Pro to ArcGIS Online. Refer to ArcGIS Pro: Overwrite a web feature layer for instructions.

Article ID: 000025302

Software:
  • ArcGIS Online
  • ArcGIS Pro 2 7 x
  • ArcGIS Pro 2 x

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options