<?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: Arcade error when using FeatureSet to get related data in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-error-when-using-featureset-to-get-related/m-p/1073865#M40986</link>
    <description>&lt;P&gt;Hello!&amp;nbsp; In Workforce is a related table with assignment types.&amp;nbsp; I am trying to pull the assignment types description field from this related table into a pop-up.&amp;nbsp; I am trying to use this code (modified of course) but get an execution error. Any tips you can toss my way would be greatly appreciated!&lt;/P&gt;&lt;P&gt;var tbl = FeatureSetByName($map,"workforce_8b965c8647bc45d79891d13f207335c8 - Assignment Types", ['description']);&lt;BR /&gt;var descr = $feature.description;&lt;BR /&gt;var sql = "assignmenttype = '" + descr + "'";&lt;BR /&gt;var target = First(Filter(tbl, sql));&lt;BR /&gt;return target.description;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Jun 2021 19:08:29 GMT</pubDate>
    <dc:creator>ahagopian_coj</dc:creator>
    <dc:date>2021-06-29T19:08:29Z</dc:date>
    <item>
      <title>Arcade error when using FeatureSet to get related data</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-error-when-using-featureset-to-get-related/m-p/570628#M28699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working with a feature layer and a separate table that have a column in common (many to one relationship). The feature layer common field name is PropName and the table field name is GIS_PropName. I'm attempting to use FeatureSets to get the value of a second field called WMAName using Arcade. I can get as far as the below but when I change the last line to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;return target.WMAName;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the following error.&amp;nbsp;&lt;SPAN class="" style="color: #de2900; background-color: rgba(255, 255, 255, 0.8);"&gt;Execution Error:&lt;/SPAN&gt;&lt;SPAN style="color: #4c4c4c; background-color: rgba(255, 255, 255, 0.8);"&gt;Runtime Error: Cannot call member property on object of this type. WMAName&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/443817_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2019 18:44:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-error-when-using-featureset-to-get-related/m-p/570628#M28699</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2019-04-24T18:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade error when using FeatureSet to get related data</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-error-when-using-featureset-to-get-related/m-p/570629#M28700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In this case target is a collection of records, which might only have one record. You can&amp;nbsp;do something like this:&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; target &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;First&lt;/SPAN&gt;&lt;SPAN class="punctuation 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="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; target&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;WMAName&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// or&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; target &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;return&lt;/SPAN&gt; target&lt;SPAN class="punctuation 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="punctuation token"&gt;.&lt;/SPAN&gt;WMAName&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:33:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-error-when-using-featureset-to-get-related/m-p/570629#M28700</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-12T00:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade error when using FeatureSet to get related data</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-error-when-using-featureset-to-get-related/m-p/570630#M28701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Xander. That first method worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mitch East&lt;/P&gt;&lt;P&gt;GIS Specialist 3, Game Management&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wildlife Resources Division&amp;lt;http://georgiawildlife.com/&amp;gt;&lt;/P&gt;&lt;P&gt;O: (706) 557-3270 | M: (678) 787-5627&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Facebook&amp;lt;http://www.facebook.com/WildlifeResourcesDivisionGADNR&amp;gt; • Twitter&amp;lt;http://twitter.com/georgiawild&amp;gt; • Instagram&amp;lt;http://www.instagram.com/georgiawildlife&amp;gt;&lt;/P&gt;&lt;P&gt;Buy a hunting or fishing license today!&amp;lt;http://georgiawildlife.com/licenses-permits-passes&amp;gt;&lt;/P&gt;&lt;P&gt;—————————————————&lt;/P&gt;&lt;P&gt;A division of the&lt;/P&gt;&lt;P&gt;GEORGIA DEPARTMENT OF NATURAL RESOURCES&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2019 19:30:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-error-when-using-featureset-to-get-related/m-p/570630#M28701</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2019-04-24T19:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade error when using FeatureSet to get related data</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-error-when-using-featureset-to-get-related/m-p/570631#M28702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm glad it worked. Just remember that the filter will return a collection even if the collection contains only a single&amp;nbsp;record. You will have to drill down to the record to be able to query the individual attribute values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2019 19:36:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-error-when-using-featureset-to-get-related/m-p/570631#M28702</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-04-24T19:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade error when using FeatureSet to get related data</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-error-when-using-featureset-to-get-related/m-p/1073865#M40986</link>
      <description>&lt;P&gt;Hello!&amp;nbsp; In Workforce is a related table with assignment types.&amp;nbsp; I am trying to pull the assignment types description field from this related table into a pop-up.&amp;nbsp; I am trying to use this code (modified of course) but get an execution error. Any tips you can toss my way would be greatly appreciated!&lt;/P&gt;&lt;P&gt;var tbl = FeatureSetByName($map,"workforce_8b965c8647bc45d79891d13f207335c8 - Assignment Types", ['description']);&lt;BR /&gt;var descr = $feature.description;&lt;BR /&gt;var sql = "assignmenttype = '" + descr + "'";&lt;BR /&gt;var target = First(Filter(tbl, sql));&lt;BR /&gt;return target.description;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jun 2021 19:08:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-error-when-using-featureset-to-get-related/m-p/1073865#M40986</guid>
      <dc:creator>ahagopian_coj</dc:creator>
      <dc:date>2021-06-29T19:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade error when using FeatureSet to get related data</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-error-when-using-featureset-to-get-related/m-p/1260745#M50508</link>
      <description>&lt;P&gt;Hopefully you've solved this before now, but for others in the same boat..&lt;BR /&gt;A likely cause is if your filter returns nothing, First() then returns null and you're attempting to retrieve the description attribute on a null, which needs to be handled.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var target = First(Filter(tbl, sql));
if(IsEmpty(target)) return '';
return target.description;&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 23 Feb 2023 02:07:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-error-when-using-featureset-to-get-related/m-p/1260745#M50508</guid>
      <dc:creator>TaylorCarnell1</dc:creator>
      <dc:date>2023-02-23T02:07:18Z</dc:date>
    </item>
  </channel>
</rss>

