Hi all,
I'm trying to include a relationship class in a map, so it'll be included when I publish the map to AGOL as a hosted feature layer. But when I right-click on the relationship class in the ArcGIS Pro catalog, the "Add To Current Map" option is grayed out.
Anybody have any ideas about what I might be doing wrong? Is there some detail about creating the relationship class that I might have missed? The layers referenced in the relationship class are already in the map.
Edited to add: When I try to just drag the relationship class from the catalog to the map, it says "Failed to add data ... The table was not found".
Thanks.
Solved! Go to Solution.
No, it is something that is honored despite not being able to directly see the relationship that you created in the map. If you already have the features that participate in the relationship in the map currently, then you should be able to test it by selecting the feature and viewing the attributes. It should look something like this:
The relationship is stored in the database; it is something that cannot be added to the map directly.
Typically when you create a relationship class, you would add both tables/features to the map for publishing. I've done this on multiple occasions.
I don't know how your relationship is set up, but depending on how it is setup, you will need to add all of the tables/features that participate in that relationship(s).
For instance, I have a sample where I have multiple features relating to a single standalone table.
So doing this should give you what you need.
Both of the feature layers the relationship class was created with were already in the map. Don't I need to add the created relationship class to the map as well? That's where I'm running into an issue.
When I right-click on the relationship class in the catalog, the "Add To Current Map" option is grayed out. (The "Add To New" submenu is there, but all of the options under that submenu are grayed out.)
And as noted, trying to simply drag the relationship class to the map fails as well - "The table was not found".
No, it is something that is honored despite not being able to directly see the relationship that you created in the map. If you already have the features that participate in the relationship in the map currently, then you should be able to test it by selecting the feature and viewing the attributes. It should look something like this:
The relationship is stored in the database; it is something that cannot be added to the map directly.
Okay, I see now that the relationship does follow when published to a web layer on AGOL.
Thank you.
I can understand why it would be confusing when only 'some' relationship classes have this context menu to add to map. Only certain types of relationship classes will have the right-click context menu to add to a map. Many-to-many relationship classes have an intermediate table and will have the context menu to add to the map - they'll show up as tables. These are also referred to as attributed relationship classes.
Here is some supporting documentation for preparing data that mentions attributed relationship classes needing to be present in the map document.
Prepare data to publish a feature service
For attributed relationship classes, include the relationship class table in the map document.