<?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 Accessing M-N and 1-M related table records in Portal Pop-ups in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/406078#M2721</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I'm an Arcade newbie trying to modify the pop up for the parcels in a web map that serves as the basis for a Portal web application. The parcels feature layer in question has a pairing of relationship classes set up to other tables in the published Map Service.&amp;nbsp; This Service, called "TL_Parcels_Activities" is added to the web map and called "Tidelands Activities" in the Contents.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Tidelands Activities" class="jive-emoji image-1 jive-image j-img-centered" height="273" src="/legacyfs/online/485459_Contents - Activities.JPG" style="display: block; margin-left: auto; margin-right: auto;" width="302" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It contains six different items with a different definition query on the parcels source data, a feature class in our geodatabase called "TL_Parcels".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TL_Parcels has a Many-to-Many relationship to the PI Numbers table, which, in turn, has a One-to-Many relationship to the Tidelands Activities table.There is also an additional 1-M relationship set up to a Site ID table.&amp;nbsp; All of these tables and relationship class tables were included in the Map Service and show up in the web map.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="TL Parcels Activities" class="jive-emoji jive-image image-2 j-img-centered" height="535" src="https://community.esri.com/legacyfs/online/485461_TL_Parcels_Activities.JPG" style="display: block; margin-left: auto; margin-right: auto;" width="267" /&gt;&lt;/P&gt;&lt;P&gt;The Related Records show up in the pop-up to open the related data in tabular form well enough...&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Parcel Popup" class="jive-emoji jive-image image-3 j-img-centered" height="335" src="/legacyfs/online/485466_Parcel Popup.JPG" style="display: block; margin-left: auto; margin-right: auto;" width="269" /&gt;&lt;/P&gt;&lt;P&gt;... but I was hoping to use Arcade to get the related info to appear in the pop-up directly, without having to click and read in the attribute tables themselves.&lt;BR /&gt; &lt;BR /&gt;I found some good examples of script suggestions on GeoNet for some 1-M situations that I tried out. I think folks were using these for AGO, which I understand has some quirky differences from the Portal environment. I started with this sample:&amp;nbsp;&amp;nbsp;&lt;A href="https://community.esri.com/thread/229436" target="_blank"&gt;How do you reference another field from a related table in Arcade?&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My initial attempts kept giving me the error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;"Execution Error:Runtime Error: Identifier Not Found. $map"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found an example that focused on the GlobalID that I decided to run with and still got the same problem.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/228235" target="_blank"&gt;Get 1:M related objects using Arcade&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;// read the GlobalID of the feature
var globalid = $feature.GlobalID;
// create a sql expression to filter the asset table
var sql = "gis_id = '" + globalid + "'";
// Access the Activities based on the name in the map
var ACTIV_view = FeatureSetByName($map, "TL_PINumbers");
// filter the assets using the sql expression
var ACTIV = Filter(ACTIV, sql);

// get the count of the related Activities
var cnt = Count(Activities);
// create a variable to hold the resulting text
var ACTIV_info = "";
// validate if there are any related records and handle accordingly
if (cnt &amp;gt; 0) {
// there is at least 1 related record, create activity info
ACTIV_info = cnt + " Activities:";
// loop through related records
for (var activity in Activities) {
// create text using name and description (you should modify this to match your needs)
var ACTIV_text = " - " + Activity.name + TextFormatting.NewLine + Activity.description;
// add the text for this activity to the activity info
ACTIV_info += TextFormatting.NewLine + ACTIV_text;
}
} else {
// no related records (or the sql query did not work)
ACTIV_info = "No related Activities";
}

return ACTIV_info;&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;/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;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;/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;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With these I could never access the &lt;STRONG&gt;$map&lt;/STRONG&gt;&amp;nbsp;from the Globals tab. Despite the fact that all of these other things were in the same web map, all I could see were the &lt;STRONG&gt;$feature&lt;/STRONG&gt; for all of the fields in the Parcels feature class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a test, I separately published&amp;nbsp;a Hosted Feature Layer of the parcels/relationships which shows the two related tables, but not the relationship classes themselves, within the service.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Hosted Feature Service" class="jive-emoji jive-image j-img-centered image-4" height="268" src="/legacyfs/online/485467_Hosted Feature Service.JPG" style="display: block; margin-left: auto; margin-right: auto;" width="271" /&gt;Then I added that to my web map and tried to use the same Arcade expression on that layer.&amp;nbsp; &lt;STRONG&gt;$map&lt;/STRONG&gt; was now accessible to me in the Globals and the code seemed to get past that sticking point, but gave me an &lt;STRONG&gt;Execution Error: Filter cannot accept this parameter type.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not always exactly sure what the sample scripts are asking for everywhere, so I'm not fully sure I'm putting the correct info where it belongs. I also know that I will probably need to do more to this to add all the attribute info I want to display and probably to get the script to go to the next level for the other 1-M relationship between the two tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 18:28:08 GMT</pubDate>
    <dc:creator>MattLashendock</dc:creator>
    <dc:date>2021-12-11T18:28:08Z</dc:date>
    <item>
      <title>Accessing M-N and 1-M related table records in Portal Pop-ups</title>
      <link>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/406078#M2721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I'm an Arcade newbie trying to modify the pop up for the parcels in a web map that serves as the basis for a Portal web application. The parcels feature layer in question has a pairing of relationship classes set up to other tables in the published Map Service.&amp;nbsp; This Service, called "TL_Parcels_Activities" is added to the web map and called "Tidelands Activities" in the Contents.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Tidelands Activities" class="jive-emoji image-1 jive-image j-img-centered" height="273" src="/legacyfs/online/485459_Contents - Activities.JPG" style="display: block; margin-left: auto; margin-right: auto;" width="302" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It contains six different items with a different definition query on the parcels source data, a feature class in our geodatabase called "TL_Parcels".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TL_Parcels has a Many-to-Many relationship to the PI Numbers table, which, in turn, has a One-to-Many relationship to the Tidelands Activities table.There is also an additional 1-M relationship set up to a Site ID table.&amp;nbsp; All of these tables and relationship class tables were included in the Map Service and show up in the web map.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="TL Parcels Activities" class="jive-emoji jive-image image-2 j-img-centered" height="535" src="https://community.esri.com/legacyfs/online/485461_TL_Parcels_Activities.JPG" style="display: block; margin-left: auto; margin-right: auto;" width="267" /&gt;&lt;/P&gt;&lt;P&gt;The Related Records show up in the pop-up to open the related data in tabular form well enough...&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Parcel Popup" class="jive-emoji jive-image image-3 j-img-centered" height="335" src="/legacyfs/online/485466_Parcel Popup.JPG" style="display: block; margin-left: auto; margin-right: auto;" width="269" /&gt;&lt;/P&gt;&lt;P&gt;... but I was hoping to use Arcade to get the related info to appear in the pop-up directly, without having to click and read in the attribute tables themselves.&lt;BR /&gt; &lt;BR /&gt;I found some good examples of script suggestions on GeoNet for some 1-M situations that I tried out. I think folks were using these for AGO, which I understand has some quirky differences from the Portal environment. I started with this sample:&amp;nbsp;&amp;nbsp;&lt;A href="https://community.esri.com/thread/229436" target="_blank"&gt;How do you reference another field from a related table in Arcade?&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My initial attempts kept giving me the error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;"Execution Error:Runtime Error: Identifier Not Found. $map"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found an example that focused on the GlobalID that I decided to run with and still got the same problem.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/228235" target="_blank"&gt;Get 1:M related objects using Arcade&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;// read the GlobalID of the feature
var globalid = $feature.GlobalID;
// create a sql expression to filter the asset table
var sql = "gis_id = '" + globalid + "'";
// Access the Activities based on the name in the map
var ACTIV_view = FeatureSetByName($map, "TL_PINumbers");
// filter the assets using the sql expression
var ACTIV = Filter(ACTIV, sql);

// get the count of the related Activities
var cnt = Count(Activities);
// create a variable to hold the resulting text
var ACTIV_info = "";
// validate if there are any related records and handle accordingly
if (cnt &amp;gt; 0) {
// there is at least 1 related record, create activity info
ACTIV_info = cnt + " Activities:";
// loop through related records
for (var activity in Activities) {
// create text using name and description (you should modify this to match your needs)
var ACTIV_text = " - " + Activity.name + TextFormatting.NewLine + Activity.description;
// add the text for this activity to the activity info
ACTIV_info += TextFormatting.NewLine + ACTIV_text;
}
} else {
// no related records (or the sql query did not work)
ACTIV_info = "No related Activities";
}

return ACTIV_info;&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;/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;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;/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;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With these I could never access the &lt;STRONG&gt;$map&lt;/STRONG&gt;&amp;nbsp;from the Globals tab. Despite the fact that all of these other things were in the same web map, all I could see were the &lt;STRONG&gt;$feature&lt;/STRONG&gt; for all of the fields in the Parcels feature class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a test, I separately published&amp;nbsp;a Hosted Feature Layer of the parcels/relationships which shows the two related tables, but not the relationship classes themselves, within the service.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Hosted Feature Service" class="jive-emoji jive-image j-img-centered image-4" height="268" src="/legacyfs/online/485467_Hosted Feature Service.JPG" style="display: block; margin-left: auto; margin-right: auto;" width="271" /&gt;Then I added that to my web map and tried to use the same Arcade expression on that layer.&amp;nbsp; &lt;STRONG&gt;$map&lt;/STRONG&gt; was now accessible to me in the Globals and the code seemed to get past that sticking point, but gave me an &lt;STRONG&gt;Execution Error: Filter cannot accept this parameter type.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not always exactly sure what the sample scripts are asking for everywhere, so I'm not fully sure I'm putting the correct info where it belongs. I also know that I will probably need to do more to this to add all the attribute info I want to display and probably to get the script to go to the next level for the other 1-M relationship between the two tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:28:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/406078#M2721</guid>
      <dc:creator>MattLashendock</dc:creator>
      <dc:date>2021-12-11T18:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing M-N and 1-M related table records in Portal Pop-ups</title>
      <link>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/406079#M2722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Matt,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Literally was working on this today! Here's some code that looks through a related table then returns the field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var relatedrecords = OrderBy(FeatureSetByRelationshipName($feature,"YourRelatedTableHere"), "YourUniqueIdentifier");&lt;BR /&gt;var cnt = Count(relatedrecords);&lt;/P&gt;&lt;P&gt;var relatedinfo = "";&lt;BR /&gt;if (cnt &amp;gt; 0) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; var info = First(relatedrecords);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; relatedinfo = info.fieldyouwanttodisplay;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;return relatedinfo;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if this works for you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Apr 2020 23:20:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/406079#M2722</guid>
      <dc:creator>RogerCleaves1</dc:creator>
      <dc:date>2020-04-10T23:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing M-N and 1-M related table records in Portal Pop-ups</title>
      <link>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/406080#M2723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Roger, Many thanks for this thread.&amp;nbsp; &amp;nbsp;We used this to&amp;nbsp;code to show a pop up using a&amp;nbsp; 1toM relatationship between a point feature and a related table.&amp;nbsp; However,&amp;nbsp; it does not show all the related records, only the first.&amp;nbsp; I cannot use the actual data but have mocked up a similar table structure&amp;nbsp; to the one we are working with.&amp;nbsp; Is there something obvious we are missing.&amp;nbsp; Thanks Paul&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Resolved...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-top: 0pt; margin-bottom: 0pt;"&gt;&lt;SPAN style="font-size: 11pt; color: #000000; background-color: transparent; font-weight: 400; text-decoration: none;"&gt;var allIngredients = FeatureSetByName($datastore, "Ingredients_all2");&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0pt; margin-bottom: 0pt;"&gt;&lt;SPAN style="font-size: 11pt; color: #000000; background-color: transparent; font-weight: 400; text-decoration: none;"&gt;var ingredients = Filter(allIngredients, "Vendor_Nam = '"+$feature["FIRST_Vendor_Nam"]+"'");&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0pt; margin-bottom: 0pt;"&gt;&lt;SPAN style="font-size: 11pt; color: #000000; background-color: transparent; font-weight: 400; text-decoration: none;"&gt;var materials = OrderBy(Distinct(ingredients, "Material_N"), "Material_N ASC");&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0pt; margin-bottom: 0pt;"&gt;&lt;SPAN style="font-size: 11pt; color: #000000; background-color: transparent; font-weight: 400; text-decoration: none;"&gt;var cnt = Count(materials);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0pt; margin-bottom: 0pt;"&gt;&lt;SPAN style="font-size: 11pt; color: #000000; background-color: transparent; font-weight: 400; text-decoration: none;"&gt;var ingredientList = "";&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0pt; margin-bottom: 0pt;"&gt;&lt;SPAN style="font-size: 11pt; color: #000000; background-color: transparent; font-weight: 400; text-decoration: none;"&gt;if (cnt &amp;gt; 0) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0pt; margin-bottom: 0pt;"&gt;&lt;SPAN style="font-size: 11pt; color: #000000; background-color: transparent; font-weight: 400; text-decoration: none;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for(var material in materials){&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0pt; margin-bottom: 0pt;"&gt;&lt;SPAN style="font-size: 11pt; color: #000000; background-color: transparent; font-weight: 400; text-decoration: none;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ingredientList += material.Material_N + '\n';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0pt; margin-bottom: 0pt;"&gt;&lt;SPAN style="font-size: 11pt; color: #000000; background-color: transparent; font-weight: 400; text-decoration: none;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0pt; margin-bottom: 0pt;"&gt;&lt;SPAN style="font-size: 11pt; color: #000000; background-color: transparent; font-weight: 400; text-decoration: none;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 0pt; margin-bottom: 0pt;"&gt;&lt;SPAN style="font-size: 11pt; color: #000000; background-color: transparent; font-weight: 400; text-decoration: none;"&gt;return ingredientList;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2020 13:17:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/406080#M2723</guid>
      <dc:creator>Islandgroup</dc:creator>
      <dc:date>2020-05-18T13:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing M-N and 1-M related table records in Portal Pop-ups</title>
      <link>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/406081#M2724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV style="color: #323130; border: 0px; font-size: 14px;"&gt;&lt;DIV style="color: inherit; border: 0px;"&gt;&lt;DIV class="" style="color: inherit; border: 0px; margin: 0px 0px 0px 52px; padding: 10px 0px 0px;"&gt;&lt;DIV class="" style="color: inherit; border: 0px;"&gt;&lt;DIV class="" style="color: inherit; border: 0px;"&gt;&lt;DIV class="" style="color: var(--neutralprimary); border: 0px; font-size: 14px;"&gt;&lt;SPAN style="color: inherit; border: 0px;"&gt;Lashendock, Matthew&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: var(--neutralsecondary); border: 0px; font-size: 12px; margin: 2px 0px 0px;"&gt;Mon 4/20/2020 11:54 AM&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV style="color: #323130; border: 0px; font-size: 14px;"&gt;&lt;DIV class="" style="color: var(--neutraldark); border: 0px; margin: 12px 16px 10px 52px; padding: 0px 0px 2px;"&gt;&lt;DIV style="color: inherit; border: 0px;"&gt;&lt;DIV class="" style="color: inherit; border: 0px;"&gt;&lt;DIV lang="EN-US" style="color: inherit; border: 0px;"&gt;&lt;DIV class="" style="color: inherit; border: 0px;"&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;Hi Roger,&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;Thank you for the reply and the scripting.&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;Tried it with this, just attempting to get the first bit of info, The PI Number field, out of the table:&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;var relatedrecords = OrderBy(FeatureSetByRelationshipName($feature,"TL_Parcels_Activities - TL_PINumbers"), "TL_PINumber");&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;var cnt = Count(relatedrecords);&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;var relatedinfo = "";&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;if (cnt &amp;gt; 0) {&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var info = First(relatedrecords);&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; relatedinfo = info.PI_NUMBER;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;}&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;return relatedinfo;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;… and got the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: red; border: 0px;"&gt;Execution Error:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4c4c4c; border: 0px; font-weight: inherit; font-size: 13pt;"&gt;Runtime Error: Function Not Found: FeatureSetByRelationshipName&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&lt;BR /&gt;That sounds like the function is not usable for that task or in the Portal environment.&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;Part of what I’m wondering is if the related table and identifier info should be listed as it actually is in the data or as it shows in the web map.&amp;nbsp;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;This is the way the service shows up with its tables in our portal:&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&lt;IMG data-custom="AAMkAGYwMzE5NWE5LTJjY2QtNGZmMy1hM2RhLTY5MzgyMTQxYmU5YwBGAAAAAADmw40ZY4aVTZzaKSQSvQ6%2FBwBKThbMnU%2F2SZ8manuJ%2F3maAAAAAAEJAABKThbMnU%2F2SZ8manuJ%2F3maAAAMar6mAAABEgAQAFVbvGv4jvJEiZF9xCeuA24%3D" data-imagetype="AttachmentByCid" height="506" src="https://attachments.office.net/owa/Matthew.Lashendock%40dep.nj.gov/service.svc/s/GetAttachmentThumbnail?id=AAMkAGYwMzE5NWE5LTJjY2QtNGZmMy1hM2RhLTY5MzgyMTQxYmU5YwBGAAAAAADmw40ZY4aVTZzaKSQSvQ6%2FBwBKThbMnU%2F2SZ8manuJ%2F3maAAAAAAEJAABKThbMnU%2F2SZ8manuJ%2F3maAAAMar6mAAABEgAQAFVbvGv4jvJEiZF9xCeuA24%3D&amp;amp;thumbnailType=2&amp;amp;owa=outlook.office365.com&amp;amp;scriptVer=2020051101.02&amp;amp;X-OWA-CANARY=tez3IQw5wUCW1X9FoHu2ZoAEISpL-9cYWl33SOp333kK0aZUTrtohMdhONBmicWf8lNZQ5gg6aQ.&amp;amp;token=eyJhbGciOiJSUzI1NiIsImtpZCI6IjU2MzU4ODUyMzRCOTI1MkRERTAwNTc2NkQ5RDlGMjc2NTY1RjYzRTIiLCJ4NXQiOiJWaldJVWpTNUpTM2VBRmRtMmRueWRsWmZZLUkiLCJ0eXAiOiJKV1QifQ.eyJvcmlnaW4iOiJodHRwczovL291dGxvb2sub2ZmaWNlMzY1LmNvbSIsInVjIjoiYWM4YjgyNjEwMDliNDY4ZmI4YTM4NzE3ZDE0NzQ2MzAiLCJ2ZXIiOiJFeGNoYW5nZS5DYWxsYmFjay5WMSIsImFwcGN0eHNlbmRlciI6Ik93YURvd25sb2FkQDUwNzZjM2QxLTM4MDItNGI5Zi1iMzZhLWUwYTQxYmQ2NDJhNyIsImlzc3JpbmciOiJHQ0NNb2RlcmF0ZSIsImFwcGN0eCI6IntcIm1zZXhjaHByb3RcIjpcIm93YVwiLFwicHJpbWFyeXNpZFwiOlwiUy0xLTUtMjEtOTQyNDMwNzQtNDk3NTk4NzMwLTE2NzUzMDEzNDItNDgwMDQ4NFwiLFwicHVpZFwiOlwiMTE1MzkwNjY2MTI5MzcwODM1MFwiLFwib2lkXCI6XCI2YjA1ZjMwZS1kYjQ0LTQyMTYtYjI5Yi0wNmNkMTU5YzgxZjRcIixcInNjb3BlXCI6XCJPd2FEb3dubG9hZFwifSIsIm5iZiI6MTU4OTgyMDQ1MywiZXhwIjoxNTg5ODIxMDUzLCJpc3MiOiIwMDAwMDAwMi0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDBANTA3NmMzZDEtMzgwMi00YjlmLWIzNmEtZTBhNDFiZDY0MmE3IiwiYXVkIjoiMDAwMDAwMDItMDAwMC0wZmYxLWNlMDAtMDAwMDAwMDAwMDAwL2F0dGFjaG1lbnRzLm9mZmljZS5uZXRANTA3NmMzZDEtMzgwMi00YjlmLWIzNmEtZTBhNDFiZDY0MmE3IiwiaGFwcCI6Im93YSJ9.HYUxQzpV5mWc8fkaiM5TX6WfbE2QLjWxmeBnlWkNKdDc43OiayayNXIRm71E4PY1u8g9JqxNQPU-DqPvDSxzghBxnOg-VxzrxG6W5Q3gajPYR2W3E8-j4GS8p3OMC2qbvrBjeaFa94nQZyfRJotkURCW28BYC4Amg4B8WmtzLUzw8h0iYN-sjyyFcvCQX4H0KOZ9idvC03xPud1X8PXZidMpUlnOvKnFmLf0Ur1WIojfd2e0QoZdZZ5S_PiGOCSSaQIWn0HBOsfan-WrP3KxWcRSx87ldSYMRWwlblmnBXwCrjthP7Ht5VuoF_ZV3KX9M_vJYeXa-xD-qIHApxubgQ&amp;amp;animation=true" style="color: inherit; border: 0px;" width="635" /&gt;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;The TL&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;PINumber&lt;/STRONG&gt;s table is actually called&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;TL_PINumbers&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in our data.&amp;nbsp; Not sure if that matters.&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;I’m hoping that if I can get the PI Number from the this table to appear in the popup, then all I would have to do is then list those other fields as well, even though they reside in that next level relationship table.&amp;nbsp; But I’m not sure if I shouldn’t be using one of the other tables listed above or not.&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;I’m not sure if the presence of the tables for the Relationship Classes that are set up for this (&lt;STRONG&gt;TL RS ToPINumbers&lt;/STRONG&gt;) confuses things at all or not.&amp;nbsp; Or if that should be the table that is used instead.&amp;nbsp; This just has the two items that are compared.&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&lt;IMG data-custom="AAMkAGYwMzE5NWE5LTJjY2QtNGZmMy1hM2RhLTY5MzgyMTQxYmU5YwBGAAAAAADmw40ZY4aVTZzaKSQSvQ6%2FBwBKThbMnU%2F2SZ8manuJ%2F3maAAAAAAEJAABKThbMnU%2F2SZ8manuJ%2F3maAAAMar6mAAABEgAQABHB%2B5aUm%2F5Kjw8gy9bI48s%3D" data-imagetype="AttachmentByCid" height="138" src="https://attachments.office.net/owa/Matthew.Lashendock%40dep.nj.gov/service.svc/s/GetAttachmentThumbnail?id=AAMkAGYwMzE5NWE5LTJjY2QtNGZmMy1hM2RhLTY5MzgyMTQxYmU5YwBGAAAAAADmw40ZY4aVTZzaKSQSvQ6%2FBwBKThbMnU%2F2SZ8manuJ%2F3maAAAAAAEJAABKThbMnU%2F2SZ8manuJ%2F3maAAAMar6mAAABEgAQABHB%2B5aUm%2F5Kjw8gy9bI48s%3D&amp;amp;thumbnailType=2&amp;amp;owa=outlook.office365.com&amp;amp;scriptVer=2020051101.02&amp;amp;X-OWA-CANARY=tez3IQw5wUCW1X9FoHu2ZoAEISpL-9cYWl33SOp333kK0aZUTrtohMdhONBmicWf8lNZQ5gg6aQ.&amp;amp;token=eyJhbGciOiJSUzI1NiIsImtpZCI6IjU2MzU4ODUyMzRCOTI1MkRERTAwNTc2NkQ5RDlGMjc2NTY1RjYzRTIiLCJ4NXQiOiJWaldJVWpTNUpTM2VBRmRtMmRueWRsWmZZLUkiLCJ0eXAiOiJKV1QifQ.eyJvcmlnaW4iOiJodHRwczovL291dGxvb2sub2ZmaWNlMzY1LmNvbSIsInVjIjoiYWM4YjgyNjEwMDliNDY4ZmI4YTM4NzE3ZDE0NzQ2MzAiLCJ2ZXIiOiJFeGNoYW5nZS5DYWxsYmFjay5WMSIsImFwcGN0eHNlbmRlciI6Ik93YURvd25sb2FkQDUwNzZjM2QxLTM4MDItNGI5Zi1iMzZhLWUwYTQxYmQ2NDJhNyIsImlzc3JpbmciOiJHQ0NNb2RlcmF0ZSIsImFwcGN0eCI6IntcIm1zZXhjaHByb3RcIjpcIm93YVwiLFwicHJpbWFyeXNpZFwiOlwiUy0xLTUtMjEtOTQyNDMwNzQtNDk3NTk4NzMwLTE2NzUzMDEzNDItNDgwMDQ4NFwiLFwicHVpZFwiOlwiMTE1MzkwNjY2MTI5MzcwODM1MFwiLFwib2lkXCI6XCI2YjA1ZjMwZS1kYjQ0LTQyMTYtYjI5Yi0wNmNkMTU5YzgxZjRcIixcInNjb3BlXCI6XCJPd2FEb3dubG9hZFwifSIsIm5iZiI6MTU4OTgyMDQ1MywiZXhwIjoxNTg5ODIxMDUzLCJpc3MiOiIwMDAwMDAwMi0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDBANTA3NmMzZDEtMzgwMi00YjlmLWIzNmEtZTBhNDFiZDY0MmE3IiwiYXVkIjoiMDAwMDAwMDItMDAwMC0wZmYxLWNlMDAtMDAwMDAwMDAwMDAwL2F0dGFjaG1lbnRzLm9mZmljZS5uZXRANTA3NmMzZDEtMzgwMi00YjlmLWIzNmEtZTBhNDFiZDY0MmE3IiwiaGFwcCI6Im93YSJ9.HYUxQzpV5mWc8fkaiM5TX6WfbE2QLjWxmeBnlWkNKdDc43OiayayNXIRm71E4PY1u8g9JqxNQPU-DqPvDSxzghBxnOg-VxzrxG6W5Q3gajPYR2W3E8-j4GS8p3OMC2qbvrBjeaFa94nQZyfRJotkURCW28BYC4Amg4B8WmtzLUzw8h0iYN-sjyyFcvCQX4H0KOZ9idvC03xPud1X8PXZidMpUlnOvKnFmLf0Ur1WIojfd2e0QoZdZZ5S_PiGOCSSaQIWn0HBOsfan-WrP3KxWcRSx87ldSYMRWwlblmnBXwCrjthP7Ht5VuoF_ZV3KX9M_vJYeXa-xD-qIHApxubgQ&amp;amp;animation=true" style="color: inherit; border: 0px;" width="515" /&gt;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;Then there is the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;SiteID&amp;nbsp; Composite&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;table which shows the connection to the relationship [Related PI Number(s)].&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&lt;IMG data-custom="AAMkAGYwMzE5NWE5LTJjY2QtNGZmMy1hM2RhLTY5MzgyMTQxYmU5YwBGAAAAAADmw40ZY4aVTZzaKSQSvQ6%2FBwBKThbMnU%2F2SZ8manuJ%2F3maAAAAAAEJAABKThbMnU%2F2SZ8manuJ%2F3maAAAMar6mAAABEgAQAPljeTHyZ6xEj4V7uBfBRsI%3D" data-imagetype="AttachmentByCid" height="146" src="https://attachments.office.net/owa/Matthew.Lashendock%40dep.nj.gov/service.svc/s/GetAttachmentThumbnail?id=AAMkAGYwMzE5NWE5LTJjY2QtNGZmMy1hM2RhLTY5MzgyMTQxYmU5YwBGAAAAAADmw40ZY4aVTZzaKSQSvQ6%2FBwBKThbMnU%2F2SZ8manuJ%2F3maAAAAAAEJAABKThbMnU%2F2SZ8manuJ%2F3maAAAMar6mAAABEgAQAPljeTHyZ6xEj4V7uBfBRsI%3D&amp;amp;thumbnailType=2&amp;amp;owa=outlook.office365.com&amp;amp;scriptVer=2020051101.02&amp;amp;X-OWA-CANARY=tez3IQw5wUCW1X9FoHu2ZoAEISpL-9cYWl33SOp333kK0aZUTrtohMdhONBmicWf8lNZQ5gg6aQ.&amp;amp;token=eyJhbGciOiJSUzI1NiIsImtpZCI6IjU2MzU4ODUyMzRCOTI1MkRERTAwNTc2NkQ5RDlGMjc2NTY1RjYzRTIiLCJ4NXQiOiJWaldJVWpTNUpTM2VBRmRtMmRueWRsWmZZLUkiLCJ0eXAiOiJKV1QifQ.eyJvcmlnaW4iOiJodHRwczovL291dGxvb2sub2ZmaWNlMzY1LmNvbSIsInVjIjoiYWM4YjgyNjEwMDliNDY4ZmI4YTM4NzE3ZDE0NzQ2MzAiLCJ2ZXIiOiJFeGNoYW5nZS5DYWxsYmFjay5WMSIsImFwcGN0eHNlbmRlciI6Ik93YURvd25sb2FkQDUwNzZjM2QxLTM4MDItNGI5Zi1iMzZhLWUwYTQxYmQ2NDJhNyIsImlzc3JpbmciOiJHQ0NNb2RlcmF0ZSIsImFwcGN0eCI6IntcIm1zZXhjaHByb3RcIjpcIm93YVwiLFwicHJpbWFyeXNpZFwiOlwiUy0xLTUtMjEtOTQyNDMwNzQtNDk3NTk4NzMwLTE2NzUzMDEzNDItNDgwMDQ4NFwiLFwicHVpZFwiOlwiMTE1MzkwNjY2MTI5MzcwODM1MFwiLFwib2lkXCI6XCI2YjA1ZjMwZS1kYjQ0LTQyMTYtYjI5Yi0wNmNkMTU5YzgxZjRcIixcInNjb3BlXCI6XCJPd2FEb3dubG9hZFwifSIsIm5iZiI6MTU4OTgyMDQ1MywiZXhwIjoxNTg5ODIxMDUzLCJpc3MiOiIwMDAwMDAwMi0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDBANTA3NmMzZDEtMzgwMi00YjlmLWIzNmEtZTBhNDFiZDY0MmE3IiwiYXVkIjoiMDAwMDAwMDItMDAwMC0wZmYxLWNlMDAtMDAwMDAwMDAwMDAwL2F0dGFjaG1lbnRzLm9mZmljZS5uZXRANTA3NmMzZDEtMzgwMi00YjlmLWIzNmEtZTBhNDFiZDY0MmE3IiwiaGFwcCI6Im93YSJ9.HYUxQzpV5mWc8fkaiM5TX6WfbE2QLjWxmeBnlWkNKdDc43OiayayNXIRm71E4PY1u8g9JqxNQPU-DqPvDSxzghBxnOg-VxzrxG6W5Q3gajPYR2W3E8-j4GS8p3OMC2qbvrBjeaFa94nQZyfRJotkURCW28BYC4Amg4B8WmtzLUzw8h0iYN-sjyyFcvCQX4H0KOZ9idvC03xPud1X8PXZidMpUlnOvKnFmLf0Ur1WIojfd2e0QoZdZZ5S_PiGOCSSaQIWn0HBOsfan-WrP3KxWcRSx87ldSYMRWwlblmnBXwCrjthP7Ht5VuoF_ZV3KX9M_vJYeXa-xD-qIHApxubgQ&amp;amp;animation=true" style="color: inherit; border: 0px;" width="571" /&gt;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;TL Activities&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;table is the second level 1:M relate that shows all the additional info in the fields above that we also want to have listed ultimately.&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&lt;IMG data-custom="AAMkAGYwMzE5NWE5LTJjY2QtNGZmMy1hM2RhLTY5MzgyMTQxYmU5YwBGAAAAAADmw40ZY4aVTZzaKSQSvQ6%2FBwBKThbMnU%2F2SZ8manuJ%2F3maAAAAAAEJAABKThbMnU%2F2SZ8manuJ%2F3maAAAMar6mAAABEgAQAM8CAAEhUm5LpwzbtyMJ3%2BI%3D" data-imagetype="AttachmentByCid" height="165" src="https://attachments.office.net/owa/Matthew.Lashendock%40dep.nj.gov/service.svc/s/GetAttachmentThumbnail?id=AAMkAGYwMzE5NWE5LTJjY2QtNGZmMy1hM2RhLTY5MzgyMTQxYmU5YwBGAAAAAADmw40ZY4aVTZzaKSQSvQ6%2FBwBKThbMnU%2F2SZ8manuJ%2F3maAAAAAAEJAABKThbMnU%2F2SZ8manuJ%2F3maAAAMar6mAAABEgAQAM8CAAEhUm5LpwzbtyMJ3%2BI%3D&amp;amp;thumbnailType=2&amp;amp;owa=outlook.office365.com&amp;amp;scriptVer=2020051101.02&amp;amp;X-OWA-CANARY=tez3IQw5wUCW1X9FoHu2ZoAEISpL-9cYWl33SOp333kK0aZUTrtohMdhONBmicWf8lNZQ5gg6aQ.&amp;amp;token=eyJhbGciOiJSUzI1NiIsImtpZCI6IjU2MzU4ODUyMzRCOTI1MkRERTAwNTc2NkQ5RDlGMjc2NTY1RjYzRTIiLCJ4NXQiOiJWaldJVWpTNUpTM2VBRmRtMmRueWRsWmZZLUkiLCJ0eXAiOiJKV1QifQ.eyJvcmlnaW4iOiJodHRwczovL291dGxvb2sub2ZmaWNlMzY1LmNvbSIsInVjIjoiYWM4YjgyNjEwMDliNDY4ZmI4YTM4NzE3ZDE0NzQ2MzAiLCJ2ZXIiOiJFeGNoYW5nZS5DYWxsYmFjay5WMSIsImFwcGN0eHNlbmRlciI6Ik93YURvd25sb2FkQDUwNzZjM2QxLTM4MDItNGI5Zi1iMzZhLWUwYTQxYmQ2NDJhNyIsImlzc3JpbmciOiJHQ0NNb2RlcmF0ZSIsImFwcGN0eCI6IntcIm1zZXhjaHByb3RcIjpcIm93YVwiLFwicHJpbWFyeXNpZFwiOlwiUy0xLTUtMjEtOTQyNDMwNzQtNDk3NTk4NzMwLTE2NzUzMDEzNDItNDgwMDQ4NFwiLFwicHVpZFwiOlwiMTE1MzkwNjY2MTI5MzcwODM1MFwiLFwib2lkXCI6XCI2YjA1ZjMwZS1kYjQ0LTQyMTYtYjI5Yi0wNmNkMTU5YzgxZjRcIixcInNjb3BlXCI6XCJPd2FEb3dubG9hZFwifSIsIm5iZiI6MTU4OTgyMDQ1MywiZXhwIjoxNTg5ODIxMDUzLCJpc3MiOiIwMDAwMDAwMi0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDBANTA3NmMzZDEtMzgwMi00YjlmLWIzNmEtZTBhNDFiZDY0MmE3IiwiYXVkIjoiMDAwMDAwMDItMDAwMC0wZmYxLWNlMDAtMDAwMDAwMDAwMDAwL2F0dGFjaG1lbnRzLm9mZmljZS5uZXRANTA3NmMzZDEtMzgwMi00YjlmLWIzNmEtZTBhNDFiZDY0MmE3IiwiaGFwcCI6Im93YSJ9.HYUxQzpV5mWc8fkaiM5TX6WfbE2QLjWxmeBnlWkNKdDc43OiayayNXIRm71E4PY1u8g9JqxNQPU-DqPvDSxzghBxnOg-VxzrxG6W5Q3gajPYR2W3E8-j4GS8p3OMC2qbvrBjeaFa94nQZyfRJotkURCW28BYC4Amg4B8WmtzLUzw8h0iYN-sjyyFcvCQX4H0KOZ9idvC03xPud1X8PXZidMpUlnOvKnFmLf0Ur1WIojfd2e0QoZdZZ5S_PiGOCSSaQIWn0HBOsfan-WrP3KxWcRSx87ldSYMRWwlblmnBXwCrjthP7Ht5VuoF_ZV3KX9M_vJYeXa-xD-qIHApxubgQ&amp;amp;animation=true" style="color: inherit; border: 0px;" width="555" /&gt;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;Hope that isn’t too confusing!&amp;nbsp; Below is a sketched diagram of how the tables are connected:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&lt;IMG data-custom="AAMkAGYwMzE5NWE5LTJjY2QtNGZmMy1hM2RhLTY5MzgyMTQxYmU5YwBGAAAAAADmw40ZY4aVTZzaKSQSvQ6%2FBwBKThbMnU%2F2SZ8manuJ%2F3maAAAAAAEJAABKThbMnU%2F2SZ8manuJ%2F3maAAAMar6mAAABEgAQAJTnJjmfxMpDt6AUiLwaNNU%3D" data-imagetype="AttachmentByCid" height="471" src="https://attachments.office.net/owa/Matthew.Lashendock%40dep.nj.gov/service.svc/s/GetAttachmentThumbnail?id=AAMkAGYwMzE5NWE5LTJjY2QtNGZmMy1hM2RhLTY5MzgyMTQxYmU5YwBGAAAAAADmw40ZY4aVTZzaKSQSvQ6%2FBwBKThbMnU%2F2SZ8manuJ%2F3maAAAAAAEJAABKThbMnU%2F2SZ8manuJ%2F3maAAAMar6mAAABEgAQAJTnJjmfxMpDt6AUiLwaNNU%3D&amp;amp;thumbnailType=2&amp;amp;owa=outlook.office365.com&amp;amp;scriptVer=2020051101.02&amp;amp;X-OWA-CANARY=tez3IQw5wUCW1X9FoHu2ZoAEISpL-9cYWl33SOp333kK0aZUTrtohMdhONBmicWf8lNZQ5gg6aQ.&amp;amp;token=eyJhbGciOiJSUzI1NiIsImtpZCI6IjU2MzU4ODUyMzRCOTI1MkRERTAwNTc2NkQ5RDlGMjc2NTY1RjYzRTIiLCJ4NXQiOiJWaldJVWpTNUpTM2VBRmRtMmRueWRsWmZZLUkiLCJ0eXAiOiJKV1QifQ.eyJvcmlnaW4iOiJodHRwczovL291dGxvb2sub2ZmaWNlMzY1LmNvbSIsInVjIjoiYWM4YjgyNjEwMDliNDY4ZmI4YTM4NzE3ZDE0NzQ2MzAiLCJ2ZXIiOiJFeGNoYW5nZS5DYWxsYmFjay5WMSIsImFwcGN0eHNlbmRlciI6Ik93YURvd25sb2FkQDUwNzZjM2QxLTM4MDItNGI5Zi1iMzZhLWUwYTQxYmQ2NDJhNyIsImlzc3JpbmciOiJHQ0NNb2RlcmF0ZSIsImFwcGN0eCI6IntcIm1zZXhjaHByb3RcIjpcIm93YVwiLFwicHJpbWFyeXNpZFwiOlwiUy0xLTUtMjEtOTQyNDMwNzQtNDk3NTk4NzMwLTE2NzUzMDEzNDItNDgwMDQ4NFwiLFwicHVpZFwiOlwiMTE1MzkwNjY2MTI5MzcwODM1MFwiLFwib2lkXCI6XCI2YjA1ZjMwZS1kYjQ0LTQyMTYtYjI5Yi0wNmNkMTU5YzgxZjRcIixcInNjb3BlXCI6XCJPd2FEb3dubG9hZFwifSIsIm5iZiI6MTU4OTgyMDQ1MywiZXhwIjoxNTg5ODIxMDUzLCJpc3MiOiIwMDAwMDAwMi0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDBANTA3NmMzZDEtMzgwMi00YjlmLWIzNmEtZTBhNDFiZDY0MmE3IiwiYXVkIjoiMDAwMDAwMDItMDAwMC0wZmYxLWNlMDAtMDAwMDAwMDAwMDAwL2F0dGFjaG1lbnRzLm9mZmljZS5uZXRANTA3NmMzZDEtMzgwMi00YjlmLWIzNmEtZTBhNDFiZDY0MmE3IiwiaGFwcCI6Im93YSJ9.HYUxQzpV5mWc8fkaiM5TX6WfbE2QLjWxmeBnlWkNKdDc43OiayayNXIRm71E4PY1u8g9JqxNQPU-DqPvDSxzghBxnOg-VxzrxG6W5Q3gajPYR2W3E8-j4GS8p3OMC2qbvrBjeaFa94nQZyfRJotkURCW28BYC4Amg4B8WmtzLUzw8h0iYN-sjyyFcvCQX4H0KOZ9idvC03xPud1X8PXZidMpUlnOvKnFmLf0Ur1WIojfd2e0QoZdZZ5S_PiGOCSSaQIWn0HBOsfan-WrP3KxWcRSx87ldSYMRWwlblmnBXwCrjthP7Ht5VuoF_ZV3KX9M_vJYeXa-xD-qIHApxubgQ&amp;amp;animation=true" style="color: inherit; border: 0px;" width="794" /&gt;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;The other table referring to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;SiteID&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is a separate second level relationship branch that is not anything we are worrying about showing.&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;Thanks for your help!&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="" style="font-size: 11pt; margin: 0in 0in 0.0001pt;"&gt;Matt&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2020 16:51:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/406081#M2724</guid>
      <dc:creator>MattLashendock</dc:creator>
      <dc:date>2020-05-18T16:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing M-N and 1-M related table records in Portal Pop-ups</title>
      <link>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/406082#M2725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/103572"&gt;Matt Lashendock&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error you obtained:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="color: red; background-color: #ffffff; border: 0px; font-size: 14.6667px;"&gt;Execution Error:&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 14.6667px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff; border: 0px; font-weight: inherit; font-size: 13pt;"&gt;Runtime Error: Function Not Found: FeatureSetByRelationshipName&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;... is most likely related to the version of Enterprise that you are using.&amp;nbsp;FeatureSetByRelationshipName was released in version 1.8 and available as of 10.8 in Enterprise. See:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/arcade/function-reference/data_functions/#featuresetbyrelationshipname" title="https://developers.arcgis.com/arcade/function-reference/data_functions/#featuresetbyrelationshipname"&gt;Data Functions | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/arcade/guide/version-matrix/" title="https://developers.arcgis.com/arcade/guide/version-matrix/"&gt;Version Matrix | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Edit: There are ways to get the related records using a Filter and the field the relationship is based upon.&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2020 19:17:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/406082#M2725</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2020-05-19T19:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing M-N and 1-M related table records in Portal Pop-ups</title>
      <link>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/406083#M2726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just found this blog article today, this seems to solve the 1-to-many iteration issue!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/community/gis/web-gis/arcgisonline/blog/2020/06/09/show-related-data-or-tables-in-pop-ups-with-arcade-featuresets"&gt;https://community.esri.com/community/gis/web-gis/arcgisonline/blog/2020/06/09/show-related-data-or-tables-in-pop-ups-with-arcade-featuresets&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2020 15:19:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/406083#M2726</guid>
      <dc:creator>RogerCleaves1</dc:creator>
      <dc:date>2020-06-11T15:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing M-N and 1-M related table records in Portal Pop-ups</title>
      <link>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/406084#M2727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/189254"&gt;Roger Cleaves&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for sharing the blog, which is indeed a nice example of&amp;nbsp;processing related data but this question is related to a specific version of ArcGIS Enterprise and I think the post is based on AGOL.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2020 21:24:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/406084#M2727</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2020-06-11T21:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing M-N and 1-M related table records in Portal Pop-ups</title>
      <link>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/406085#M2728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3100"&gt;Xander Bakker&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am running 10.6.1 and was wondering if you can expand on your edit: "&amp;nbsp;&lt;EM style="background-color: #ffffff; border: 0px;"&gt;There are ways to get the related records using a Filter and the field the relationship is based upon."&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Oct 2020 22:58:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/406085#M2728</guid>
      <dc:creator>RickeyFight</dc:creator>
      <dc:date>2020-10-05T22:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing M-N and 1-M related table records in Portal Pop-ups</title>
      <link>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/406086#M2729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/40178"&gt;Rickey Fite&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The FeatureSetBy* functions and the Filter functions were introduced at Enterprise version 10.7 in Arcade version 1.5 (see: &lt;A class="link-titled" href="https://developers.arcgis.com/arcade/guide/version-matrix/" title="https://developers.arcgis.com/arcade/guide/version-matrix/"&gt;Version Matrix | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;). Unfortunately, with Enterprise 10.6.1 you have no possibility to do this.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Oct 2020 14:10:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/406086#M2729</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2020-10-06T14:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing M-N and 1-M related table records in Portal Pop-ups</title>
      <link>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/406087#M2730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3100"&gt;Xander Bakker&lt;/A&gt;‌ I thought that was the case. Thank you for confirming that.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Oct 2020 14:32:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/406087#M2730</guid>
      <dc:creator>RickeyFight</dc:creator>
      <dc:date>2020-10-06T14:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing M-N and 1-M related table records in Portal Pop-ups</title>
      <link>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/1107309#M6030</link>
      <description>&lt;P&gt;I had the same issue as you while trying to follow the online examples:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;&lt;SPAN&gt;My initial attempts kept giving me the error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;"Execution Error:Runtime Error: Identifier Not Found. $map"&lt;/STRONG&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I managed to trace this back to whether I had added the MapService or FeatureService to my map.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;MapService: $map was not found.&lt;/LI&gt;&lt;LI&gt;FeatureService: $map exists.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was still unable to get the FeatureSetByRelationshipName to work.&amp;nbsp;I am currently applying the relate using ArcGISPro when publishing the service definition. So it is not enforced by a relationship class in the underlying enterprise geodatabase, so that may be related. But I haven't got around to trialing this yet.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 21:08:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/1107309#M6030</guid>
      <dc:creator>PaulBarr</dc:creator>
      <dc:date>2021-10-13T21:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing M-N and 1-M related table records in Portal Pop-ups</title>
      <link>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/1156163#M6228</link>
      <description>&lt;P&gt;Our organization has since updated to Enterprise server 10.8, allowing us to access the FeatureSetByName and FeatureSetByID functions. Re-visiting this, we've been able to write code for both the M-N primary relationship and the 1-M secondary relationship, each residing in separate popups.&lt;/P&gt;&lt;P&gt;The following is the code that functions to return the primary relationship data for the "PI Number" identifier residing in the&amp;nbsp; first table related to the primary feature class.&amp;nbsp; The key in the first relationship is the "PAMS_PIN" field.&amp;nbsp; The "PI_Number" field in the related table acts as the key to the second relationship.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;//Read out ID of the feature
var ID=$feature["PAMS_PIN"];

//Access related table
var tbl1=FeatureSetByName($map,"Cadastral - Tidelands PI Numbers Composite");

//Create an SQL expression to query on ID
var sql="PAMS_PIN= '" + ID + "'";

//Filter the table using the SQL expression
var reldata=Filter(tbl1,sql);

//Count the resulting records
var cnt=Count(reldata);

//Initiate a variable to hold the result
var result=0;

//Check for records found for ID
if (cnt&amp;gt;0){
    //Loop through related records
    for (var row in reldata){
        //Read the ID from the related data
        result += row.PI_NUMBER + TextFormatting.NewLine;
    }    
} else {
    result = "No Activities listed";
}
return result; reldata&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Of note in line 24 is the use of "+=" for the result to allow for multiple records to be returned, if present, instead of only one (using only "=").&lt;/P&gt;&lt;P&gt;After saving the expression, it was inserted into the popup's HTML in a specific table location (See attached files).&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 16:06:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/1156163#M6228</guid>
      <dc:creator>MattLashendock</dc:creator>
      <dc:date>2022-03-22T16:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing M-N and 1-M related table records in Portal Pop-ups</title>
      <link>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/1156270#M6229</link>
      <description>&lt;P&gt;We also worked on a solution to extract data from a one to many relationship. Below is the result of the pop-up that shows the PI record (the related table information to the GIS Layer (parcels)) and the subsequent file numbers and status of the files (fields in a related table to the PI record table)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Pop-Up.PNG" style="width: 263px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/36992i0BF43D88E7814EB7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Pop-Up.PNG" alt="Pop-Up.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This was the code for the pop-up.&amp;nbsp; We used &lt;STRONG&gt;FeatureSetByID&lt;/STRONG&gt; instead of &lt;STRONG&gt;FeatureSetbyName&lt;/STRONG&gt;.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var tbl_pi = FeatureSetById($map, /* Cadastral - Tidelands PI Numbers Composite */ "Cadastral_2933")
var tbl_act = FeatureSetById($map, /* Cadastral - Tidelands Activities */ "Cadastral_5847")

var PAMS_PIN = $feature["PAMS_PIN"];
var sql = "PAMS_PIN = @PAMS_PIN";
var Pam_Records = Filter(tbl_pi, sql);
var cnt = Count(Pam_Records);
var Record_List = "";
 
if (cnt&amp;gt;0)

{
    for (var Pam_Record in Pam_Records){  
		var pi = Pam_Record.PI_NUMBER;
        Record_List += TextFormatting.NewLine + "PI Number: " + pi + TextFormatting.NewLine;
		
		 // filter tbl_act
        var file_no = Pam_Record.PI_NUMBER
		
        var activities = Filter(tbl_act, "PI_NUMBER = @file_no")
        var tableresults = ""
        for(var act in activities) {
            var txt_FileNumber = act.FILE_NUMBER;
			var status = act.DOCUMENT_STATUS;
			var pi = act.PI_NUMBER;
			var Doc_Status_Date = "Doc Status Date: " + Text(act.DOCUMENT_STATUS_DATE, 'MM/DD/Y');
            tableresults += "File # "+ txt_FileNumber + TextFormatting.NewLine + Doc_Status_Date + TextFormatting.NewLine + "Status: " + status + TextFormatting.NewLine + TextFormatting.NewLine;
        }
        Record_List += TextFormatting.NewLine + tableresults; 
    }
} else {
    Record_List = "No Records";
}
 
return Record_List;&lt;/LI-CODE&gt;&lt;P&gt;You can place the expression by selecting a description from one field or by selecting custom configuration and adding the expression:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Pop-Up Set Up1.PNG" style="width: 303px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/36993i833CA912E4D291CB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Pop-Up Set Up1.PNG" alt="Pop-Up Set Up1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Pop-Up Set Up2.PNG" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/36994i145552E2353A00F2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Pop-Up Set Up2.PNG" alt="Pop-Up Set Up2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 17:45:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/accessing-m-n-and-1-m-related-table-records-in/m-p/1156270#M6229</guid>
      <dc:creator>MagdaUsarek-Witek</dc:creator>
      <dc:date>2022-03-22T17:45:41Z</dc:date>
    </item>
  </channel>
</rss>

