<?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 Create joined hosted view using first layer shape and second layer attachments in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/create-joined-hosted-view-using-first-layer-shape/m-p/1604311#M4973</link>
    <description>&lt;P&gt;When you create a joined hosted feature layer view, the view retains the shape (geometry) and the attachments of the target layer/table.&lt;/P&gt;&lt;P&gt;Is it possible to programmatically use the shape of the target layer and the attachments of the joined layer (or vice versa)?&lt;/P&gt;&lt;P&gt;I tried "forcing" the geometryField of the relatedTable (join) as below, but it doesn't work (the join worked, but geometry seems empty/not valid).&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
    "layers": [
        {
            "name": "name",
            "displayField": "",
            "description": "",
            "adminLayerInfo": {
                "viewLayerDefinition": {
                    "table": {
                        "name": "layer_target",
                        "sourceServiceName": "name of target service",
                        "sourceLayerId": 0,
                        "sourceLayerFields": ["*"],
                        "relatedTables": [
                            {
                                "name": "layer_join",
                                "sourceServiceName": "name of join service",
                                "sourceLayerId": 0,
                                "sourceLayerFields": ["*"],
                                "type": "LEFT",
                                "parentKeyFields": ["id"],
                                "keyFields": ["id"],
                                "topFilter": {
                                    "groupByFields": "id",
                                    "orderByFields": "id ASC",
                                    "topCount": 1
                                }
                            }
                        ],
                        "materialized": false
                    }
                },
                "geometryField": {
                    "name": "layer_join.SHAPE"
                }
            }
        }
    ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need the polygon shape from one layer and the attachments from the other.&lt;/P&gt;&lt;P&gt;I realize I could copy the attachments, but wondering if there is a simpler way, such as in a view.&lt;/P&gt;&lt;P&gt;Any ideas? Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 09 Apr 2025 20:10:08 GMT</pubDate>
    <dc:creator>mikaël</dc:creator>
    <dc:date>2025-04-09T20:10:08Z</dc:date>
    <item>
      <title>Create joined hosted view using first layer shape and second layer attachments</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/create-joined-hosted-view-using-first-layer-shape/m-p/1604311#M4973</link>
      <description>&lt;P&gt;When you create a joined hosted feature layer view, the view retains the shape (geometry) and the attachments of the target layer/table.&lt;/P&gt;&lt;P&gt;Is it possible to programmatically use the shape of the target layer and the attachments of the joined layer (or vice versa)?&lt;/P&gt;&lt;P&gt;I tried "forcing" the geometryField of the relatedTable (join) as below, but it doesn't work (the join worked, but geometry seems empty/not valid).&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
    "layers": [
        {
            "name": "name",
            "displayField": "",
            "description": "",
            "adminLayerInfo": {
                "viewLayerDefinition": {
                    "table": {
                        "name": "layer_target",
                        "sourceServiceName": "name of target service",
                        "sourceLayerId": 0,
                        "sourceLayerFields": ["*"],
                        "relatedTables": [
                            {
                                "name": "layer_join",
                                "sourceServiceName": "name of join service",
                                "sourceLayerId": 0,
                                "sourceLayerFields": ["*"],
                                "type": "LEFT",
                                "parentKeyFields": ["id"],
                                "keyFields": ["id"],
                                "topFilter": {
                                    "groupByFields": "id",
                                    "orderByFields": "id ASC",
                                    "topCount": 1
                                }
                            }
                        ],
                        "materialized": false
                    }
                },
                "geometryField": {
                    "name": "layer_join.SHAPE"
                }
            }
        }
    ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need the polygon shape from one layer and the attachments from the other.&lt;/P&gt;&lt;P&gt;I realize I could copy the attachments, but wondering if there is a simpler way, such as in a view.&lt;/P&gt;&lt;P&gt;Any ideas? Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Apr 2025 20:10:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/create-joined-hosted-view-using-first-layer-shape/m-p/1604311#M4973</guid>
      <dc:creator>mikaël</dc:creator>
      <dc:date>2025-04-09T20:10:08Z</dc:date>
    </item>
  </channel>
</rss>

