<?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: How do you reference another field from a related table in Arcade? in Nonprofit Program Questions</title>
    <link>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5100#M10</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/10114"&gt;Ken Morefield&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is possible is a similar way. You will have a Site Inspection that will link to multiple Pollutions and for each pollution you will possibly have a number of violations. This will need to nest another loop and filter each set of violations for each pollution that you have. It is possible, but depending the performance of these multiple queries you will know if this is a good thing to do.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Apr 2019 13:36:50 GMT</pubDate>
    <dc:creator>XanderBakker</dc:creator>
    <dc:date>2019-04-16T13:36:50Z</dc:date>
    <item>
      <title>How do you reference another field from a related table in Arcade?</title>
      <link>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5094#M4</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Through a Web Map in ArcGIS Online, I'm creating a field in Feature #1 and Feature #1 is related to Feature #2.&amp;nbsp; Is there a way to get the specific values in Feature #2 that are related via for an Arcade expression in Feature #1?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's a &lt;STRONG&gt;1 to many&lt;/STRONG&gt; relate and &lt;STRONG&gt;related through a Text&lt;/STRONG&gt; ID Field that they both have.&amp;nbsp;&lt;IMG __jive_id="438133" alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/438133_Feature1Feature2.PNG" /&gt;&lt;BR /&gt;EDIT: I think it has something to do with FeatureSetBy functions&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2019 14:19:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5094#M4</guid>
      <dc:creator>deleted-user-TRj-mR_qEmwV</dc:creator>
      <dc:date>2019-02-26T14:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reference another field from a related table in Arcade?</title>
      <link>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5095#M5</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/355262" target="_blank"&gt;Scott Tram&lt;/A&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find below a sample of how you can do this. It really depends a lot on what you want to do with the related results and how your data is structured:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// first read out the ID of the Feature1&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; id &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; $feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ID&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// access the table Feature2&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; tbl &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$map&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Feature2'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// create a sql expression to query on ID&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; sql &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ID = '"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; ID &lt;SPAN class="operator 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="comment token"&gt;// filter the table using the sql expression&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; related_data &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Filter&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tbl&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; sql&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// count the resulting records&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; cnt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Count&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;related_data&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// initiate a variable to hold the result&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; cnt &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" related records"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// check if there are related records found for the current ID&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cnt &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;// loop through related records&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; related_data&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        &lt;SPAN class="comment token"&gt;// read some data and create the line you want&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; line &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; TextFormatting&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NewLine &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" - "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SomeFieldOfInterest&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        &lt;SPAN class="comment token"&gt;// add the line to the result&lt;/SPAN&gt;
        result &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; line&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;else&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"No related records:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// return the result&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; result&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;/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;Some more examples and explanation can be found here:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://community.esri.com/thread/227958" target="_blank"&gt;Summarize Features in a pop-up with Arcade&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://community.esri.com/docs/DOC-12773-using-featuresetby-functions-in-arcade-to-drill-down-to-other-layers-and-tables" target="_blank"&gt;https://community.esri.com/docs/DOC-12773-using-featuresetby-functions-in-arcade-to-drill-down-to-other-layers-and-tables&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:11:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5095#M5</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-10T20:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reference another field from a related table in Arcade?</title>
      <link>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5096#M6</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Xander,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for the reply. I'm a bit confused at the line:&lt;/P&gt;&lt;P&gt;&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="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;var&lt;/SPAN&gt; cnt &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="" style="color: #d74444; border: 0px; font-weight: inherit;"&gt;Count&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;related_data&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;;&lt;/SPAN&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;it seems to generate an error message.&lt;BR /&gt;&lt;IMG class="image-1 jive-image" height="223" src="https://community.esri.com/legacyfs/online/438301_pastedImage_1.png" width="524" /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;My Feature1 is a point layer and it has an attribute table that is related to Feature2 which is just a CSV layer/table. They are related with a 1:many relationship through having a ID_TEXT field. Do the two features have to have the same Name/Alias for the related field? I'm using ID_TEXT for feature 1 and TEXT_ID for feature 2. Thanks again.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:11:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5096#M6</guid>
      <dc:creator>deleted-user-TRj-mR_qEmwV</dc:creator>
      <dc:date>2021-12-10T20:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reference another field from a related table in Arcade?</title>
      <link>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5097#M7</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess the error is probably generated by the sql expression. It should have the correct name of the field. Did you change the field name ID in the code to ID_TEXT?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Feb 2019 22:30:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5097#M7</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-02-27T22:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reference another field from a related table in Arcade?</title>
      <link>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5098#M8</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Xander, I figured it out. I think what happened was one field was indexed while the other field wasn't indexed(*).&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2019 15:26:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5098#M8</guid>
      <dc:creator>deleted-user-TRj-mR_qEmwV</dc:creator>
      <dc:date>2019-02-28T15:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reference another field from a related table in Arcade?</title>
      <link>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5099#M9</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xander,&lt;/P&gt;&lt;P&gt;I'm wondering if your suggested Arcade solution could be expanded to include 3 relationships deep?&amp;nbsp; Your example shows a "Parent - Child" relationship.&amp;nbsp; I'm wondering if Arcade can handle a "Grandparent - Parent - Child" relationship?&amp;nbsp; Any idea on how to code that?&amp;nbsp; My example consists of a Site Inpection (Grandparent), where multiple instances of Pollution can be found (Parent), and for each Pollution instance - multiple Violations can occur.&amp;nbsp; Site Inspection&amp;gt;Pollution&amp;gt;Violation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&amp;nbsp; I'm working on modifying your code provided above, but I'm not quite getting there!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Apr 2019 21:10:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5099#M9</guid>
      <dc:creator>KenMorefield</dc:creator>
      <dc:date>2019-04-15T21:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reference another field from a related table in Arcade?</title>
      <link>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5100#M10</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/10114"&gt;Ken Morefield&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is possible is a similar way. You will have a Site Inspection that will link to multiple Pollutions and for each pollution you will possibly have a number of violations. This will need to nest another loop and filter each set of violations for each pollution that you have. It is possible, but depending the performance of these multiple queries you will know if this is a good thing to do.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Apr 2019 13:36:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5100#M10</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-04-16T13:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reference another field from a related table in Arcade?</title>
      <link>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5101#M11</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xander,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to show attributes on a point feature service pop-up from a table using a primary and foreign key, 1-1 relationship. I have followed your example above and get an error when I try to use Filter the way you have shown. The data is hosted on ArcGIS Online as a Feature Layer and a Table. Any thoughts about what the issue could be? I am new to arcade so any help would be appreciated.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="447088" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/447088_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 May 2019 22:14:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5101#M11</guid>
      <dc:creator>ChelseyAiton2</dc:creator>
      <dc:date>2019-05-08T22:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reference another field from a related table in Arcade?</title>
      <link>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5102#M12</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is a strange error message. You are using the Filter function and provide a FeatureSet and a string representing the SQL query. Since you write the sql to the Console, can you have a look at the message&amp;nbsp;written and share it here? If possible, access to the data would help a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2019 12:51:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5102#M12</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-05-09T12:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reference another field from a related table in Arcade?</title>
      <link>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5103#M13</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I require special permission to share the whole dataset, so I have provided a trimmed down version of the data. For Ms_points2, I have removed all but 5 features, the schema remains the same. For the table, I have kept the same 5 related records and removed the majority of the fields.&amp;nbsp; A little more background, appraisers in the field will be using an app to edit the location of the points. The table service will be overwritten weekly from an export from the assessor's office database. Therefore, the point layer is editable and the table is not.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It feels like the expression isn't actually connecting to the table service.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Removed links to test data: Deleted feature services&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="447143" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/447143_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2019 15:50:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5103#M13</guid>
      <dc:creator>ChelseyAiton2</dc:creator>
      <dc:date>2019-05-09T15:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reference another field from a related table in Arcade?</title>
      <link>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5104#M14</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/330634" target="_blank"&gt;Chelsey Aiton&lt;/A&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure why it is not working for you. It seems to be working with the sample data you shared:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" height="284" src="https://community.esri.com/legacyfs/online/447133_pastedImage_2.png" width="349" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Arcade expression used:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; tbl &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$map&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"MS_table2 - ms_table2"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;Console&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Count&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tbl&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;var&lt;/SPAN&gt; pt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; $feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;TAXACCT&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;Console&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;pt&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; sql &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"TAXACCT = '"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; pt &lt;SPAN class="operator 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="token function"&gt;Console&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;sql&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; msaccts &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Filter&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tbl&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; sql&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; cnt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Count&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;msaccts&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"There are no related records..."&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cnt &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Related records: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; cnt&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; msacct &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; msaccts&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        result &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; TextFormatting&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NewLine &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" - "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; msacct&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;PARK &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" ("&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; msacct&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;PARKNUM &lt;SPAN class="operator 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="keyword token"&gt;return&lt;/SPAN&gt; result&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;/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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:11:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5104#M14</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-10T20:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reference another field from a related table in Arcade?</title>
      <link>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5105#M15</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much for spending the time assisting me! I was able to get it to work based upon your above script. I believe two things in combination were happening. My original script used $datastore in the first line, which now I know represents a collection of layers in the same feature service. My layers are in different feature services, so I needed to use $map. Also, when I had tried variations of the layer name, which I also didn't have exactly correct, I was still using $datastore, which gives you the same error message as when you have just the layer name incorrect, using $map. (I thought FeatureSetByName would use the layer name given to the service rather than the name given to it in the web map. If you rename the layer in the map, this breaks the expression).&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2019 17:22:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5105#M15</guid>
      <dc:creator>ChelseyAiton2</dc:creator>
      <dc:date>2019-05-09T17:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reference another field from a related table in Arcade?</title>
      <link>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5106#M16</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's a very important thing you are mentioning: the difference between using the $datastore&amp;nbsp;or the $map to access data and the name of the layer in the map or in the hosted feature service. Please note that the navigation provided by the Arcade expression window allows you to have access to:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;content in the datastore&lt;/LI&gt;&lt;LI&gt;content in the map&lt;/LI&gt;&lt;LI&gt;the exact names of the fields&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, use the larger than sign "&amp;gt;" to the right to access in this case the content of the $map:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" height="215" src="https://community.esri.com/legacyfs/online/447224_pastedImage_1.png" width="426" /&gt;&lt;/P&gt;&lt;P&gt;Once in the $map, you can see every available layer, or navigate the fields in the layer using once again the larger than sign:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" height="298" src="https://community.esri.com/legacyfs/online/447225_pastedImage_2.png" width="496" /&gt;&lt;/P&gt;&lt;P&gt;and you will see the fields:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" height="316" src="https://community.esri.com/legacyfs/online/447226_pastedImage_3.png" width="511" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2019 19:08:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5106#M16</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-05-09T19:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reference another field from a related table in Arcade?</title>
      <link>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5107#M17</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Xander, this navigation is exactly what I was missing. Thanks for providing this.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2019 19:23:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5107#M17</guid>
      <dc:creator>ChelseyAiton2</dc:creator>
      <dc:date>2019-05-09T19:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reference another field from a related table in Arcade?</title>
      <link>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5108#M18</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My pleasure!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2019 19:35:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5108#M18</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-05-09T19:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reference another field from a related table in Arcade?</title>
      <link>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5109#M19</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;Hi &lt;A href="https://community.esri.com/migrated-users/3100"&gt;Xander Bakker&lt;/A&gt;‌,&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;I'm looking to do something similar with Arcade. I have a feature service with related table. Within the related table I want to pull data from one field containing quantity and I want to multiply this by 2.50 as this is the price. The result would the value I want to use in my popup. How would I accomplish this?&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Aug 2019 14:09:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5109#M19</guid>
      <dc:creator>joerodmey</dc:creator>
      <dc:date>2019-08-15T14:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reference another field from a related table in Arcade?</title>
      <link>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5110#M20</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/333537"&gt;joe rodmey&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the value you want to extract from the related table is a single value or the sum of multiple values, this result can be used to&amp;nbsp;multiply by 2.50 before showing it in the pop-up. You would basically use the same structure as explained above, however, you would not concatenate a text, but you would have a single value or the sum of multiple values extracted from different records. If you can explain a little more about what you have so far and how&amp;nbsp;the structure of your data is,&amp;nbsp;I can help you configure the Arcade expression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Aug 2019 14:47:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5110#M20</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-08-15T14:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reference another field from a related table in Arcade?</title>
      <link>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5111#M21</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" target="_blank"&gt;Xander Bakker&lt;/A&gt; This I what I have so far&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// first read out the ID of the Feature1&lt;/SPAN&gt;
var id &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; $feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;objectid&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// access the table Feature2&lt;/SPAN&gt;
var tbl &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$datastore&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Work"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// create a sql expression to query on ID&lt;/SPAN&gt;
var sql &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ID = '"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; ID &lt;SPAN class="operator 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="comment token"&gt;// filter the table using the sql expression&lt;/SPAN&gt;
var related_data &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Filter&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tbl&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; sql&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// count the resulting records&lt;/SPAN&gt;
var cnt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Count&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;related_data&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// initiate a variable to hold the result&lt;/SPAN&gt;
var result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; cnt &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" related records"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// check if there are related records found for the current ID&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cnt &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;// loop through related records&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;var row in related_data&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        &lt;SPAN class="comment token"&gt;// read some data and create the line you want&lt;/SPAN&gt;
        var line &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; TextFormatting&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NewLine &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" - "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Item&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        &lt;SPAN class="comment token"&gt;// add the line to the result&lt;/SPAN&gt;
        result &lt;SPAN class="operator token"&gt;+=&lt;/SPAN&gt; line&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;else&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"No related records:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// return the result&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; result&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;/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;Some info on my data:&lt;/P&gt;&lt;P&gt;-Related table is called "Work"&lt;/P&gt;&lt;P&gt;-Within related table I want to pull the data in field "Item"&lt;/P&gt;&lt;P&gt;-From the "Item" field I want to take that and multiply it by 2.5&lt;/P&gt;&lt;P&gt;-Need to do this for every point i have in my feature service and show it as a new field in the popup&lt;/P&gt;&lt;P&gt;-Will then take that value and pass it into Survey123 using the custom attribute disapy and the custom URL to send to Survey123&lt;/P&gt;&lt;P&gt;-Not common to have multiple related records on one feature service point but it can happen sometimes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:11:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5111#M21</guid>
      <dc:creator>joerodmey</dc:creator>
      <dc:date>2021-12-10T20:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reference another field from a related table in Arcade?</title>
      <link>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5112#M22</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/333537" target="_blank"&gt;joe rodmey&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try something like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// first read out the ID of the Feature1&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; id &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; $feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;objectid&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// access the table Feature2&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; tbl &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$datastore&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Work"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// create a sql expression to query on ID&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; sql &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ID = '"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; ID &lt;SPAN class="operator 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="comment token"&gt;// filter the table using the sql expression&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; related_data &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Filter&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tbl&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; sql&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// count the resulting records&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; cnt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Count&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;related_data&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// initiate a variable to hold the result&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// check if there are related records found for the current ID&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cnt &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;// loop through related records&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; related_data&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        &lt;SPAN class="comment token"&gt;// add the value  to the result&lt;/SPAN&gt;
        result &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;item&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="comment token"&gt;// return the result&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; result &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2.5&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;/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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:11:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5112#M22</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-10T20:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do you reference another field from a related table in Arcade?</title>
      <link>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5113#M23</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &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 get the following error: "Execution Error: Error"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I pulling the ID properly here: "var id = $feature.objectid;"&lt;/P&gt;&lt;P&gt;This objected reflect the object ID from the point feature service and not the related table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Aug 2019 19:29:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/nonprofit-program-questions/how-do-you-reference-another-field-from-a-related/m-p/5113#M23</guid>
      <dc:creator>joerodmey</dc:creator>
      <dc:date>2019-08-15T19:29:28Z</dc:date>
    </item>
  </channel>
</rss>

