<?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 Using join data source as source for feature layer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-join-data-source-as-source-for-feature-layer/m-p/592919#M55479</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does anyone have an example of using a join data source as the source for a feature layer?&amp;nbsp; I've successfully done this in the Flex API, but am having difficulty with the JS equivalent.&amp;nbsp; Here's a bit of my code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var rightTableSource = new LayerDataSource();
&amp;nbsp; rightTableSource.dataSource = new TableDataSource({
&amp;nbsp; workspaceId: "[workspaceid]",
&amp;nbsp; dataSourceName: "[tablename]"
});
var leftTableSource = new LayerMapSource({
&amp;nbsp; mapLayerId: 0
});
var dataSource = new JoinDataSource({
&amp;nbsp; joinType: "left-outer-join",
&amp;nbsp; leftTableKey: "Name",
&amp;nbsp; rightTableKey: "Name",
&amp;nbsp; leftTableSource: leftTableSource,
&amp;nbsp; rightTableSource: rightTableSource
});

var featureLayer = new FeatureLayer("[urltomapservice]/dynamicLayer", {
&amp;nbsp; id: "featureLayer",
&amp;nbsp; mode: FeatureLayer.MODE_ONDEMAND,
&amp;nbsp; source: dataSource,
&amp;nbsp; outFields: ["*"]
});&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't get an error, so I assume it's working but the joined fields are not recognized.&amp;nbsp; I know this is possible with a dynamic map service layer.&amp;nbsp; Any ideas are much appreciated.&amp;nbsp; Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 01:27:47 GMT</pubDate>
    <dc:creator>BethManghi</dc:creator>
    <dc:date>2021-12-12T01:27:47Z</dc:date>
    <item>
      <title>Using join data source as source for feature layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-join-data-source-as-source-for-feature-layer/m-p/592919#M55479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does anyone have an example of using a join data source as the source for a feature layer?&amp;nbsp; I've successfully done this in the Flex API, but am having difficulty with the JS equivalent.&amp;nbsp; Here's a bit of my code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var rightTableSource = new LayerDataSource();
&amp;nbsp; rightTableSource.dataSource = new TableDataSource({
&amp;nbsp; workspaceId: "[workspaceid]",
&amp;nbsp; dataSourceName: "[tablename]"
});
var leftTableSource = new LayerMapSource({
&amp;nbsp; mapLayerId: 0
});
var dataSource = new JoinDataSource({
&amp;nbsp; joinType: "left-outer-join",
&amp;nbsp; leftTableKey: "Name",
&amp;nbsp; rightTableKey: "Name",
&amp;nbsp; leftTableSource: leftTableSource,
&amp;nbsp; rightTableSource: rightTableSource
});

var featureLayer = new FeatureLayer("[urltomapservice]/dynamicLayer", {
&amp;nbsp; id: "featureLayer",
&amp;nbsp; mode: FeatureLayer.MODE_ONDEMAND,
&amp;nbsp; source: dataSource,
&amp;nbsp; outFields: ["*"]
});&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't get an error, so I assume it's working but the joined fields are not recognized.&amp;nbsp; I know this is possible with a dynamic map service layer.&amp;nbsp; Any ideas are much appreciated.&amp;nbsp; Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:27:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-join-data-source-as-source-for-feature-layer/m-p/592919#M55479</guid>
      <dc:creator>BethManghi</dc:creator>
      <dc:date>2021-12-12T01:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using join data source as source for feature layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-join-data-source-as-source-for-feature-layer/m-p/592920#M55480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Beth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had this problem as well when initially developing our app. I ultimately went about binding data a different way... I am interested to see if anyone has info as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 15:27:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-join-data-source-as-source-for-feature-layer/m-p/592920#M55480</guid>
      <dc:creator>ChrisSmith7</dc:creator>
      <dc:date>2015-05-26T15:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using join data source as source for feature layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-join-data-source-as-source-for-feature-layer/m-p/592921#M55481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually, I need to revised what I said.&amp;nbsp; With the code as I have it above, I get this error:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="objectBox opened objectBox-errorMessage hasTwisty hasBreakSwitch"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="objectBox opened objectBox-errorMessage hasTwisty hasBreakSwitch"&gt;Error: Invalid source 'type' for dynamic layer with 'id': -1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="objectBox opened objectBox-errorMessage hasTwisty hasBreakSwitch"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="objectBox opened objectBox-errorMessage hasTwisty hasBreakSwitch"&gt;I looked at the API and there is a field for type (string) but I don't know what value to put there or whether that would even solve the problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 15:46:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-join-data-source-as-source-for-feature-layer/m-p/592921#M55481</guid>
      <dc:creator>BethManghi</dc:creator>
      <dc:date>2015-05-26T15:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using join data source as source for feature layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-join-data-source-as-source-for-feature-layer/m-p/592922#M55482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I've figured it out.&amp;nbsp; I set up the layer data source incorrectly and used the wrong name for a property.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my revised code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var rightTableSource = new LayerDataSource();&lt;/P&gt;&lt;P&gt;&amp;nbsp; rightTableSource.dataSource = new TableDataSource({&lt;/P&gt;&lt;P&gt;&amp;nbsp; workspaceId: "[workspaceid]",&lt;/P&gt;&lt;P&gt;&amp;nbsp; dataSourceName: "[tablename]"&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;var leftTableSource = new LayerMapSource({&lt;/P&gt;&lt;P&gt;&amp;nbsp; mapLayerId: 0&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;var joinDataSource = new JoinDataSource({&lt;/P&gt;&lt;P&gt;&amp;nbsp; joinType: "left-outer-join",&lt;/P&gt;&lt;P&gt;&amp;nbsp; leftTableKey: "Name",&lt;/P&gt;&lt;P&gt;&amp;nbsp; rightTableKey: "Name",&lt;/P&gt;&lt;P&gt;&amp;nbsp; leftTableSource: leftTableSource,&lt;/P&gt;&lt;P&gt;&amp;nbsp; rightTableSource: rightTableSource&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;var layerDataSource = new LayerDataSource();&lt;/P&gt;&lt;P&gt;layerDataSource.dataSource = joinDataSource;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to set the feature layer source as a JoinDataSource, when it really needs to be a Layer Data Source.&amp;nbsp; And the Layer Data Source has it's "dataSource" (not "source") as the JoinDataSource.&amp;nbsp; "Source" is the property name in the Flex API.&amp;nbsp; Got a bit crossed up!&amp;nbsp; This should work as the source for a feature layer and query task.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 17:34:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-join-data-source-as-source-for-feature-layer/m-p/592922#M55482</guid>
      <dc:creator>BethManghi</dc:creator>
      <dc:date>2015-05-26T17:34:33Z</dc:date>
    </item>
  </channel>
</rss>

