Select to view content in your preferred language

Create joined hosted view using first layer shape and second layer attachments

91
0
2 weeks ago
Labels (1)
mikaël
Frequent Contributor

When you create a joined hosted feature layer view, the view retains the shape (geometry) and the attachments of the target layer/table.

Is it possible to programmatically use the shape of the target layer and the attachments of the joined layer (or vice versa)?

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).

{
    "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"
                }
            }
        }
    ]
}

 

I need the polygon shape from one layer and the attachments from the other.

I realize I could copy the attachments, but wondering if there is a simpler way, such as in a view.

Any ideas? Thanks!

0 Kudos
0 Replies