<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Relationship Class Using Python in ArcGIS Notebooks Questions</title>
    <link>https://community.esri.com/t5/arcgis-notebooks-questions/relationship-class-using-python/m-p/1123760#M453</link>
    <description>&lt;P&gt;The only access points are in the data management toolset, for instance&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/create-relationship-class.htm" target="_blank"&gt;Create Relationship Class (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;but you can use arcpy to determine relationship class properties, eg&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/relationshipclass-properties.htm" target="_blank"&gt;RelationshipClass properties—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Dec 2021 12:15:43 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2021-12-08T12:15:43Z</dc:date>
    <item>
      <title>Relationship Class Using Python</title>
      <link>https://community.esri.com/t5/arcgis-notebooks-questions/relationship-class-using-python/m-p/1123747#M452</link>
      <description>&lt;P&gt;I want to create Relationship Class using python (notebook) between two hostel feature layer with UID.&lt;/P&gt;&lt;P&gt;I created a project on ArcGIS Pro which has a series of relation classes between different polygons and tables&lt;/P&gt;&lt;P&gt;This has been uploaded to ArcGIS online so that we can collect data using Field Maps.&lt;/P&gt;&lt;P&gt;Unfortunately, we forgot to add an inspection table in ArcGIS pro. Now that the&amp;nbsp; feature layer is online and our team are collecting data we can't re-upload after making changes in ArcGIS Pro. So, we are searching for at way to create a relationship class with table between a new table created in ArcGIS online and the feature layer that we already uploaded.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 11:34:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-notebooks-questions/relationship-class-using-python/m-p/1123747#M452</guid>
      <dc:creator>AbidHiraSaath</dc:creator>
      <dc:date>2021-12-08T11:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: Relationship Class Using Python</title>
      <link>https://community.esri.com/t5/arcgis-notebooks-questions/relationship-class-using-python/m-p/1123760#M453</link>
      <description>&lt;P&gt;The only access points are in the data management toolset, for instance&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/create-relationship-class.htm" target="_blank"&gt;Create Relationship Class (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;but you can use arcpy to determine relationship class properties, eg&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/relationshipclass-properties.htm" target="_blank"&gt;RelationshipClass properties—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 12:15:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-notebooks-questions/relationship-class-using-python/m-p/1123760#M453</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-12-08T12:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Relationship Class Using Python</title>
      <link>https://community.esri.com/t5/arcgis-notebooks-questions/relationship-class-using-python/m-p/1123775#M454</link>
      <description>&lt;P&gt;Unfortunately, there's no way that I'm aware of to add a relationship across two different hosted feature services. Even if you had the table added to the same service, adding the &lt;EM&gt;relationship&lt;/EM&gt; is still tricky, though some users claim to have done it by editing the JSON of the service layers.&lt;/P&gt;&lt;P&gt;A relationship in AGOL looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;"relationships": [
    {
      "keyField": "name",
      "role": "esriRelRoleOrigin",
      "composite": false,
      "name": "sanitary_retired",
      "relatedTableId": 3,
      "id": 0,
      "cardinality": "esriRelCardinalityOneToMany"
    }
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There's simply nowhere in the relationship definition to look for an outside service; it has to be in the same service.&lt;/P&gt;&lt;P&gt;There are plenty of posts on here about "can I add a layer to a service without republishing?", and some interesting suggestions in response to them. In my experience however, the only reliable way to add or remove a layer from an existing service is to republish.&lt;/P&gt;&lt;P&gt;Any chance you could schedule something like this to happen overnight?&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Pause editing on the service&lt;/LI&gt;&lt;LI&gt;Download entire service to local files in ArcGIS Pro&lt;/LI&gt;&lt;LI&gt;Make sure inspection table is added to the layer list&lt;/LI&gt;&lt;LI&gt;Republish and overwrite&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;If you &lt;EM&gt;add &lt;/EM&gt;a service, make sure you only add it to the &lt;EM&gt;bottom&lt;/EM&gt; of the list, otherwise your layer index will get messed up, and existing maps using the service will probably edit the wrong layers.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 13:28:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-notebooks-questions/relationship-class-using-python/m-p/1123775#M454</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-12-08T13:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Relationship Class Using Python</title>
      <link>https://community.esri.com/t5/arcgis-notebooks-questions/relationship-class-using-python/m-p/1287337#M652</link>
      <description>&lt;P&gt;After you create your relationship dictionary, you can add that to the layer definition. You need to add a relationship to both the layer and the table.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;lyr.manager.add_to_definition({"relationships": [lyr_rel_dict]})
tbl.manager.add_to_definition({"relationships": [tbl_rel_dict]})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 17:01:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-notebooks-questions/relationship-class-using-python/m-p/1287337#M652</guid>
      <dc:creator>AustinDoezema</dc:creator>
      <dc:date>2023-05-09T17:01:06Z</dc:date>
    </item>
  </channel>
</rss>

