<?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 Re: Tables and Relationships in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tables-and-relationships/m-p/200787#M18616</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you loading your non-spatial table?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #4c4c4c; background-color: #ffffff; margin-bottom: 1.5rem;"&gt;Non-spatial table instance can be created from the table&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url" style="color: #0079c1; text-decoration: none;"&gt;url&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in a service and the table must be loaded by calling&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#load" style="color: #0079c1; text-decoration: none;"&gt;load()&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;method.&lt;/P&gt;&lt;PRE style="color: #4c4c4c; background-color: #ffffff; font-size: 16px; margin-bottom: 1.5rem;"&gt;&lt;CODE class="" style="color: #595959; background-color: #f8f8f8; border: 1px solid #efefef; font-size: 0.875em;"&gt;&lt;SPAN class="" style="color: #006a00;"&gt;// Add a non-spatial table.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #5c2699;"&gt;require&lt;/SPAN&gt;([&lt;SPAN class="" style="color: #c41a16;"&gt;"esri/layers/FeatureLayer"&lt;/SPAN&gt;], &lt;SPAN class=""&gt;&lt;SPAN class="" style="color: #aa0d91; font-weight: bold;"&gt;function&lt;/SPAN&gt;(&lt;SPAN class="" style="color: #5c2699;"&gt;FeatureLayer&lt;/SPAN&gt;)&lt;/SPAN&gt;{   &lt;SPAN class="" style="color: #006a00;"&gt;// points to the non-spatial table in a service storing San Francisco crime incidents.&lt;/SPAN&gt;  &lt;SPAN class="" style="color: #aa0d91; font-weight: bold;"&gt;const&lt;/SPAN&gt; table = &lt;SPAN class="" style="color: #aa0d91; font-weight: bold;"&gt;new&lt;/SPAN&gt; FeatureLayer({     &lt;SPAN class=""&gt;url&lt;/SPAN&gt;: &lt;SPAN class="" style="color: #c41a16;"&gt;"https://sampleserver6.arcgisonline.com/arcgis/rest/services/SF311/FeatureServer/1"&lt;/SPAN&gt;  });   table.load().then(&lt;SPAN class=""&gt;&lt;SPAN class="" style="color: #aa0d91; font-weight: bold;"&gt;function&lt;/SPAN&gt;(&lt;SPAN class="" style="color: #5c2699;"&gt;&lt;/SPAN&gt;) &lt;/SPAN&gt;{      &lt;SPAN class="" style="color: #006a00;"&gt;// table is loaded. ready to be queried on the server.&lt;/SPAN&gt;  }); });&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a doc:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#creating-a-featurelayer" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#creating-a-featurelayer"&gt;FeatureLayer | ArcGIS API for JavaScript 4.17&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Oct 2020 21:43:53 GMT</pubDate>
    <dc:creator>UndralBatsukh</dc:creator>
    <dc:date>2020-10-13T21:43:53Z</dc:date>
    <item>
      <title>Tables and Relationships</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tables-and-relationships/m-p/200786#M18615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a feature service that contains a feature layer ("Management Regions") and several tables. The layer has a M:M relationship with Table 1 ("Source"), and that table has M:M relationships with the other tables.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/510833_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/510834_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;P&gt;When I add the layer as a FeatureLayer, I can see the Source relate using the relationships property. However, if I add the table as a FeatureLayer, its relationships property is null. Is there a way to get the relationships for the table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;  &lt;SPAN class="keyword token"&gt;const&lt;/SPAN&gt; regionLayer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;FeatureLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    url&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'https://services2.arcgis.com/blah/FeatureServer/0'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
    outFields&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'*'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
  &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;const&lt;/SPAN&gt; sourceTable &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;FeatureLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    url&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'https://services2.arcgis.com/blah/FeatureServer/1'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
    outFields&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'*'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
  &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:59:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tables-and-relationships/m-p/200786#M18615</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-12-11T09:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: Tables and Relationships</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tables-and-relationships/m-p/200787#M18616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you loading your non-spatial table?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #4c4c4c; background-color: #ffffff; margin-bottom: 1.5rem;"&gt;Non-spatial table instance can be created from the table&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url" style="color: #0079c1; text-decoration: none;"&gt;url&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in a service and the table must be loaded by calling&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#load" style="color: #0079c1; text-decoration: none;"&gt;load()&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;method.&lt;/P&gt;&lt;PRE style="color: #4c4c4c; background-color: #ffffff; font-size: 16px; margin-bottom: 1.5rem;"&gt;&lt;CODE class="" style="color: #595959; background-color: #f8f8f8; border: 1px solid #efefef; font-size: 0.875em;"&gt;&lt;SPAN class="" style="color: #006a00;"&gt;// Add a non-spatial table.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #5c2699;"&gt;require&lt;/SPAN&gt;([&lt;SPAN class="" style="color: #c41a16;"&gt;"esri/layers/FeatureLayer"&lt;/SPAN&gt;], &lt;SPAN class=""&gt;&lt;SPAN class="" style="color: #aa0d91; font-weight: bold;"&gt;function&lt;/SPAN&gt;(&lt;SPAN class="" style="color: #5c2699;"&gt;FeatureLayer&lt;/SPAN&gt;)&lt;/SPAN&gt;{   &lt;SPAN class="" style="color: #006a00;"&gt;// points to the non-spatial table in a service storing San Francisco crime incidents.&lt;/SPAN&gt;  &lt;SPAN class="" style="color: #aa0d91; font-weight: bold;"&gt;const&lt;/SPAN&gt; table = &lt;SPAN class="" style="color: #aa0d91; font-weight: bold;"&gt;new&lt;/SPAN&gt; FeatureLayer({     &lt;SPAN class=""&gt;url&lt;/SPAN&gt;: &lt;SPAN class="" style="color: #c41a16;"&gt;"https://sampleserver6.arcgisonline.com/arcgis/rest/services/SF311/FeatureServer/1"&lt;/SPAN&gt;  });   table.load().then(&lt;SPAN class=""&gt;&lt;SPAN class="" style="color: #aa0d91; font-weight: bold;"&gt;function&lt;/SPAN&gt;(&lt;SPAN class="" style="color: #5c2699;"&gt;&lt;/SPAN&gt;) &lt;/SPAN&gt;{      &lt;SPAN class="" style="color: #006a00;"&gt;// table is loaded. ready to be queried on the server.&lt;/SPAN&gt;  }); });&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a doc:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#creating-a-featurelayer" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#creating-a-featurelayer"&gt;FeatureLayer | ArcGIS API for JavaScript 4.17&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2020 21:43:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tables-and-relationships/m-p/200787#M18616</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2020-10-13T21:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: Tables and Relationships</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tables-and-relationships/m-p/200788#M18617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Loading the table was the step I missed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2020 23:49:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/tables-and-relationships/m-p/200788#M18617</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2020-10-15T23:49:09Z</dc:date>
    </item>
  </channel>
</rss>

