<?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 Query dynamicmapservice related tables in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-dynamicmapservice-related-tables/m-p/606498#M56708</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using identify to return info about multiple DynamicMapServiceLayers, and using the initializeSidebar function rather than a popup. This works fine but 3 of my services contain related data in a table that I'd like to identifya layer on so that it brings back the related fields in an additional side panel that's different from the initial identify&lt;/P&gt;&lt;P&gt;For example I identify layer 1 - it has a field called UNIT1. That field is related to table 1 field UNIT2.&amp;nbsp;I want the additional relationship identify to return all the data in the table including 'UNIT2' in a different side panel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've carried out a bit of research online but can't really understand how&amp;nbsp;to&amp;nbsp;return&amp;nbsp;the related fields. Can anyone help?&lt;/P&gt;&lt;P&gt;This is the first part of my code to identify the layer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function executeIdentifyTask(event) {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IdentifyParams.geometry = event.mapPoint;&lt;BR /&gt; IdentifyParams.mapExtent = map.extent;&lt;/P&gt;&lt;P&gt;var deferred = identifyTask&lt;BR /&gt; .execute(IdentifyParams)&lt;BR /&gt; .addCallback(function (response) {&lt;BR /&gt; // response is an array of identify result objects&lt;BR /&gt; // Let's return an array of features.&lt;BR /&gt; return arrayUtils.map(response, function (result) {&lt;/P&gt;&lt;P&gt;var feature = result.feature;&lt;/P&gt;&lt;P&gt;var layerName = result.layerName;&lt;/P&gt;&lt;P&gt;feature.attributes.layerName = layerName;&lt;BR /&gt; if (layerName === 'My Layer') {&lt;/P&gt;&lt;P&gt;var taxParcelTemplate = new InfoTemplate("",&lt;BR /&gt; "My layer &amp;lt;br/&amp;gt; &amp;lt;b&amp;gt;UNIT1:&amp;lt;b&amp;gt; ${UNIT1} ");&lt;/P&gt;&lt;P&gt;feature.setInfoTemplate(taxParcelTemplate);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;return feature;&lt;/P&gt;&lt;P&gt;});&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;map.infoWindow.setFeatures([deferred]);&lt;BR /&gt; map.infoWindow.show(event.mapPoint);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the 2nd part to add the results of the identify in a side panel;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function initializeSidebar(map) {&lt;BR /&gt; var popup = map.infoWindow;&lt;/P&gt;&lt;P&gt;//when the selection changes update the side panel to display the popup info for the&lt;BR /&gt; //currently selected feature.&lt;BR /&gt; connect.connect(popup, "onSelectionChange", function () {&lt;BR /&gt; displayPopupContent(popup.getSelectedFeature());&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;//when the selection is cleared remove the popup content from the side panel.&lt;BR /&gt; connect.connect(popup, "onClearFeatures", function () {&lt;BR /&gt; //dom.byId replaces dojo.byId&lt;BR /&gt; //dom.byId("featureCount").innerHTML = "No features were selected, click again on the map layer";&lt;BR /&gt; //registry.byId replaces dijit.byId&lt;BR /&gt; $("#leftPane").html();&lt;BR /&gt; domUtils.hide(dom.byId("pager"));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;//When features are associated with the map's info window update the sidebar with the new content.&lt;BR /&gt; connect.connect(popup, "onSetFeatures", function () {&lt;BR /&gt; &lt;BR /&gt; displayPopupContent(popup.getSelectedFeature());&lt;BR /&gt; //dom.byId("featureCount").innerHTML = popup.features.length + " feature(s) selected";&lt;/P&gt;&lt;P&gt;//enable navigation if more than one feature is selected&lt;BR /&gt; //popup.features.length &amp;gt; 1 ? domUtils.show(dom.byId("pager")) : domUtils.hide(dom.byId("pager"));&lt;BR /&gt; });&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; function displayPopupContent(feature) {&lt;BR /&gt;var content = feature.getContent();&lt;BR /&gt; $("#leftPane").html(content);&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;function selectPrevious() {&lt;BR /&gt; map.infoWindow.selectPrevious();&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;function selectNext() {&lt;BR /&gt; map.infoWindow.selectNext();&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Oct 2016 15:14:04 GMT</pubDate>
    <dc:creator>OliviaGill1</dc:creator>
    <dc:date>2016-10-11T15:14:04Z</dc:date>
    <item>
      <title>Query dynamicmapservice related tables</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-dynamicmapservice-related-tables/m-p/606498#M56708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using identify to return info about multiple DynamicMapServiceLayers, and using the initializeSidebar function rather than a popup. This works fine but 3 of my services contain related data in a table that I'd like to identifya layer on so that it brings back the related fields in an additional side panel that's different from the initial identify&lt;/P&gt;&lt;P&gt;For example I identify layer 1 - it has a field called UNIT1. That field is related to table 1 field UNIT2.&amp;nbsp;I want the additional relationship identify to return all the data in the table including 'UNIT2' in a different side panel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've carried out a bit of research online but can't really understand how&amp;nbsp;to&amp;nbsp;return&amp;nbsp;the related fields. Can anyone help?&lt;/P&gt;&lt;P&gt;This is the first part of my code to identify the layer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function executeIdentifyTask(event) {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IdentifyParams.geometry = event.mapPoint;&lt;BR /&gt; IdentifyParams.mapExtent = map.extent;&lt;/P&gt;&lt;P&gt;var deferred = identifyTask&lt;BR /&gt; .execute(IdentifyParams)&lt;BR /&gt; .addCallback(function (response) {&lt;BR /&gt; // response is an array of identify result objects&lt;BR /&gt; // Let's return an array of features.&lt;BR /&gt; return arrayUtils.map(response, function (result) {&lt;/P&gt;&lt;P&gt;var feature = result.feature;&lt;/P&gt;&lt;P&gt;var layerName = result.layerName;&lt;/P&gt;&lt;P&gt;feature.attributes.layerName = layerName;&lt;BR /&gt; if (layerName === 'My Layer') {&lt;/P&gt;&lt;P&gt;var taxParcelTemplate = new InfoTemplate("",&lt;BR /&gt; "My layer &amp;lt;br/&amp;gt; &amp;lt;b&amp;gt;UNIT1:&amp;lt;b&amp;gt; ${UNIT1} ");&lt;/P&gt;&lt;P&gt;feature.setInfoTemplate(taxParcelTemplate);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;return feature;&lt;/P&gt;&lt;P&gt;});&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;map.infoWindow.setFeatures([deferred]);&lt;BR /&gt; map.infoWindow.show(event.mapPoint);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the 2nd part to add the results of the identify in a side panel;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function initializeSidebar(map) {&lt;BR /&gt; var popup = map.infoWindow;&lt;/P&gt;&lt;P&gt;//when the selection changes update the side panel to display the popup info for the&lt;BR /&gt; //currently selected feature.&lt;BR /&gt; connect.connect(popup, "onSelectionChange", function () {&lt;BR /&gt; displayPopupContent(popup.getSelectedFeature());&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;//when the selection is cleared remove the popup content from the side panel.&lt;BR /&gt; connect.connect(popup, "onClearFeatures", function () {&lt;BR /&gt; //dom.byId replaces dojo.byId&lt;BR /&gt; //dom.byId("featureCount").innerHTML = "No features were selected, click again on the map layer";&lt;BR /&gt; //registry.byId replaces dijit.byId&lt;BR /&gt; $("#leftPane").html();&lt;BR /&gt; domUtils.hide(dom.byId("pager"));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;//When features are associated with the map's info window update the sidebar with the new content.&lt;BR /&gt; connect.connect(popup, "onSetFeatures", function () {&lt;BR /&gt; &lt;BR /&gt; displayPopupContent(popup.getSelectedFeature());&lt;BR /&gt; //dom.byId("featureCount").innerHTML = popup.features.length + " feature(s) selected";&lt;/P&gt;&lt;P&gt;//enable navigation if more than one feature is selected&lt;BR /&gt; //popup.features.length &amp;gt; 1 ? domUtils.show(dom.byId("pager")) : domUtils.hide(dom.byId("pager"));&lt;BR /&gt; });&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; function displayPopupContent(feature) {&lt;BR /&gt;var content = feature.getContent();&lt;BR /&gt; $("#leftPane").html(content);&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;function selectPrevious() {&lt;BR /&gt; map.infoWindow.selectPrevious();&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;function selectNext() {&lt;BR /&gt; map.infoWindow.selectNext();&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2016 15:14:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-dynamicmapservice-related-tables/m-p/606498#M56708</guid>
      <dc:creator>OliviaGill1</dc:creator>
      <dc:date>2016-10-11T15:14:04Z</dc:date>
    </item>
  </channel>
</rss>

