I'm trying to follow this tutorial: https://www.esri.com/arcgis-blog/products/mapping/mapping/smart-mapping-with-dynamic-workspaces/ to join dynamically a table from an SDE to a layer on map.
I've registered the workspace, giving to the user registered in the sde connection full privileges for the database, and enabled the dynamic layers on the MapService, but when i try to execute the JoinDataSource the layer disappear from the map.
I also tried to make the query directly from rest:
https://<<server-url>>/arcgis/rest/services/<<layer-name>>/MapServer/export?
Using the following parameter for dynamic layers:
[{"id":13,"name":"Province","source":{"type":"dataLayer","dataSource":{"type":"joinTable","leftTableSource":{"type":"mapLayer","mapLayerId":13},"rightTableSource":{"type":"dataLayer","dataSource":{"type":"table","workspaceId":"TEST","dataSourceName":"DYNAMIC_TEST"}},"leftTableKey":"CPROV_18","rightTableKey":"CPROV","joinType":"esriLeftOuterJoin"}},"minScale":0,"maxScale":0}]
but the result is an empty image.
I tried differend combinations for the right dataSourceName (ex: DYNAMIC_TEST, SDE_TEST.sde.DYNAMIC_TEST) as well for the rightTableKey, but the result is always an empty image.
The javascript code is the following:
var joinDataSource = new JoinDataSource({
joinType: "left-outer-join",
leftTableSource: new LayerMapSource({
type: "mapLayer",
mapLayerId: 13
}),
leftTableKey: "CPROV_18",
rightTableKey: "CPROV",
rightTableSource: new LayerDataSource({
dataSource: new TableDataSource({
type: "table",
workspaceId: "TEST",
dataSourceName: "DYNAMIC_TEST"
})
})
});
Attached there is the result of the export
Is there someone who knows what the problem can be?