<?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 Arcade Expression pulling from Related Records in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-pulling-from-related-records/m-p/1251026#M49942</link>
    <description>&lt;P&gt;Hi all I need some help!&amp;nbsp; This is my arcade expression which is resulting in all palms returning a 'Yes' value. Any clue what is wrong with my expression? Any help is appreciated.&lt;/P&gt;&lt;P&gt;Mahalo,&lt;/P&gt;&lt;P&gt;Meg&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var reltbl = OrderBy(FeatureSetById($map, /* Individual Palm Damage Survey */ "Collector_Palms_9566"),"SurveyDate DES")&lt;BR /&gt;var cnt = Count(reltbl)&lt;/P&gt;&lt;P&gt;var sprdmg = ''&lt;BR /&gt;var borehls = ''&lt;BR /&gt;var inrfrnd = ''&lt;BR /&gt;var outfrnd = ''&lt;/P&gt;&lt;P&gt;if (cnt&amp;gt;0){&lt;BR /&gt;var info = First(reltbl);&lt;BR /&gt;sprdmg = info.SpearDamage;&lt;BR /&gt;borehls = info.BoreHoles;&lt;BR /&gt;inrfrnd = info.InnerFrondsDamaged;&lt;BR /&gt;outfrnd = info.OuterFrondsDamaged;&lt;/P&gt;&lt;P&gt;if(sprdmg == "No" &amp;amp;&amp;amp; borehls == "No" &amp;amp;&amp;amp; inrfrnd == "0" &amp;amp;&amp;amp; outfrnd == "0"){&lt;BR /&gt;return "No"&lt;BR /&gt;}&lt;BR /&gt;if(sprdmg == NULL &amp;amp;&amp;amp; borehls == NULL &amp;amp;&amp;amp; inrfrnd == NULL &amp;amp;&amp;amp; outfrnd == NULL){&lt;BR /&gt;return "Null"&lt;BR /&gt;}else {&lt;BR /&gt;return "Yes"&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Tue, 24 Jan 2023 20:56:54 GMT</pubDate>
    <dc:creator>CRBData1</dc:creator>
    <dc:date>2023-01-24T20:56:54Z</dc:date>
    <item>
      <title>Arcade Expression pulling from Related Records</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-pulling-from-related-records/m-p/1251026#M49942</link>
      <description>&lt;P&gt;Hi all I need some help!&amp;nbsp; This is my arcade expression which is resulting in all palms returning a 'Yes' value. Any clue what is wrong with my expression? Any help is appreciated.&lt;/P&gt;&lt;P&gt;Mahalo,&lt;/P&gt;&lt;P&gt;Meg&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var reltbl = OrderBy(FeatureSetById($map, /* Individual Palm Damage Survey */ "Collector_Palms_9566"),"SurveyDate DES")&lt;BR /&gt;var cnt = Count(reltbl)&lt;/P&gt;&lt;P&gt;var sprdmg = ''&lt;BR /&gt;var borehls = ''&lt;BR /&gt;var inrfrnd = ''&lt;BR /&gt;var outfrnd = ''&lt;/P&gt;&lt;P&gt;if (cnt&amp;gt;0){&lt;BR /&gt;var info = First(reltbl);&lt;BR /&gt;sprdmg = info.SpearDamage;&lt;BR /&gt;borehls = info.BoreHoles;&lt;BR /&gt;inrfrnd = info.InnerFrondsDamaged;&lt;BR /&gt;outfrnd = info.OuterFrondsDamaged;&lt;/P&gt;&lt;P&gt;if(sprdmg == "No" &amp;amp;&amp;amp; borehls == "No" &amp;amp;&amp;amp; inrfrnd == "0" &amp;amp;&amp;amp; outfrnd == "0"){&lt;BR /&gt;return "No"&lt;BR /&gt;}&lt;BR /&gt;if(sprdmg == NULL &amp;amp;&amp;amp; borehls == NULL &amp;amp;&amp;amp; inrfrnd == NULL &amp;amp;&amp;amp; outfrnd == NULL){&lt;BR /&gt;return "Null"&lt;BR /&gt;}else {&lt;BR /&gt;return "Yes"&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 20:56:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-pulling-from-related-records/m-p/1251026#M49942</guid>
      <dc:creator>CRBData1</dc:creator>
      <dc:date>2023-01-24T20:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression pulling from Related Records</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-pulling-from-related-records/m-p/1251032#M49943</link>
      <description>&lt;P&gt;Are the InnerFrondsDamaged and OuterFrondsDamaged fields numeric or text? If they're numbers, than your first if statement should be&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if(sprdmg == "No" &amp;amp;&amp;amp; borehls == "No" &amp;amp;&amp;amp; inrfrnd == 0 &amp;amp;&amp;amp; outfrnd == 0){&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 21:13:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-pulling-from-related-records/m-p/1251032#M49943</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-01-24T21:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression pulling from Related Records</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-pulling-from-related-records/m-p/1251033#M49944</link>
      <description>&lt;P&gt;Hard to tell, exactly, but the way this is written, your conditions have a few different "offramps".&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;If no values exist in the related table, it wouldn't return anything.&lt;/LI&gt;&lt;LI&gt;If those four fields are "No" or "0", it returns "No"&lt;UL&gt;&lt;LI&gt;Are the second two fields really strings? If they are integers, write it 'inrfrnd == 0'. Checking an integer field being equal to a string will guarantee that nothing will ever satisfy the condition.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;If all the fields are null, it returns "Null". Nothing appears wrong with this condition, but you may want to try using &lt;STRONG&gt;IsEmpty(sprdmg) &lt;/STRONG&gt;instead, on the off chance that a field has an empty string, which is not the same as a true null.&lt;/LI&gt;&lt;LI&gt;Else return "Yes"&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;My guess is that maybe point 2 is evaluating strings / integers, so it's always missed, and maybe you have empty strings, so point 3 is being missed as well?&lt;/P&gt;&lt;P&gt;Any chance this layer is public? It's always easier to diagnose issues with access to the data.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 21:15:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-pulling-from-related-records/m-p/1251033#M49944</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2023-01-24T21:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression pulling from Related Records</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-pulling-from-related-records/m-p/1251079#M49949</link>
      <description>&lt;P&gt;The two fields are strings and the other two are integers so I went with your suggestion writing it as infrnd == 0 instead. And even with just that first line of statement (removing the other lines) to test it, the value would result in Null so it must be a problem with that first line.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found that if I made a label with a similar arcade expression instead of in the pop up, this worked and shows what palms are currently damaged vs. not.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all for your help and quick responses as well!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 23:34:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-pulling-from-related-records/m-p/1251079#M49949</guid>
      <dc:creator>crbdata</dc:creator>
      <dc:date>2023-01-24T23:34:43Z</dc:date>
    </item>
  </channel>
</rss>

