<?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 expression for pop-up in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-for-pop-up/m-p/1405966#M58479</link>
    <description>&lt;P&gt;It uses the relationship name that's set up in ArcGIS Pro&lt;/P&gt;</description>
    <pubDate>Thu, 04 Apr 2024 18:39:46 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2024-04-04T18:39:46Z</dc:date>
    <item>
      <title>Arcade expression for pop-up</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-for-pop-up/m-p/1393440#M58005</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I am very new to Arcade and am trying to create an expression that can generate a list of needed maintenance activities in the pop-up of an associated feature. This particular dataset involves a maintenance record for trees, where users can add necessary maintenance types to a related table for each marked tree. When the maintenance activity is completed, the user updates this related record by adding the date in which the maintenance was completed and switching the attribute for the 'Maintenance Needed' field from true to false.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to build an expression that can filter through these related records, choosing only the ones where 'Maintenance Needed' = True, and listing out each 'Maintenance Type' that has been assigned to the tree. That way, my users can just click on the pop-up and view what maintenance still needs to be completed on said tree.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated, thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 21:02:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-for-pop-up/m-p/1393440#M58005</guid>
      <dc:creator>KarynaB</dc:creator>
      <dc:date>2024-03-08T21:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression for pop-up</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-for-pop-up/m-p/1393466#M58007</link>
      <description>&lt;P&gt;Do you have a relationship set up between the FeatureSet and the related table? If so, you can use this syntax to get the related records&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var related = FeatureSetByRelationshipName($feature, "the relationship name");&lt;/LI-CODE&gt;&lt;P&gt;If not, then you'll get the related records by filtering the table using the common field (relateField, in this example).&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var relTable = FeatureSetByName($map,'table', ['*'], false);
var attribute = $feature.relateField;
var related = Filter(relTable, "relaterField = @attribute");&lt;/LI-CODE&gt;&lt;P&gt;From that, filter the related records for the ones that need maintenance.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var records = Filter(related, "MaintenanceNeeded = 'True'");
if (Count(records) = 0) return "No maintenance needed";
var output = "Maintenance Needed: " + TextFormatting.NewLine; 
for (var f in records) {
  output += "  " + f.MainenanceType + TextFormatting.NewLine;
}
return output;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 21:30:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-for-pop-up/m-p/1393466#M58007</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-03-08T21:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression for pop-up</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-for-pop-up/m-p/1394049#M58018</link>
      <description>&lt;P&gt;That almost worked! The expression is just not returning any of the field values under Maintenance Type. I've attached a screenshot for reference.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 12:53:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-for-pop-up/m-p/1394049#M58018</guid>
      <dc:creator>KarynaB</dc:creator>
      <dc:date>2024-03-11T12:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression for pop-up</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-for-pop-up/m-p/1394314#M58032</link>
      <description>&lt;P&gt;I was able to figure it out! I don't know how to remove the comma from the last maintenance activity needed, but at least the activities are displaying in the pop-up!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my code in case anyone else would like to reference it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 19:13:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-for-pop-up/m-p/1394314#M58032</guid>
      <dc:creator>KarynaB</dc:creator>
      <dc:date>2024-03-11T19:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression for pop-up</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-for-pop-up/m-p/1394935#M58066</link>
      <description>&lt;P&gt;One way to remove that last comma:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;return Left(output, Count(output)-2)&lt;/LI-CODE&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 21:39:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-for-pop-up/m-p/1394935#M58066</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2024-03-12T21:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression for pop-up</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-for-pop-up/m-p/1394981#M58067</link>
      <description>&lt;P&gt;You can &lt;A href="https://developers.arcgis.com/arcade/function-reference/array_functions/#push" target="_self"&gt;Push&lt;/A&gt; the results into an array and use &lt;A href="https://developers.arcgis.com/arcade/function-reference/text_functions/#concatenate" target="_self"&gt;Concatenate&lt;/A&gt; to put them into a comma-separated string&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if (Count(records) == 0) return "No maintenance needed";
var output = [];
for (var f in truerecords) {
  Push(output, f.Main_Type)
}
return Concatenate(output, ', ')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 22:59:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-for-pop-up/m-p/1394981#M58067</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-03-12T22:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression for pop-up</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-for-pop-up/m-p/1405945#M58477</link>
      <description>&lt;P&gt;Quick question since this post is fairly new. Is FeatureSetByRelationshipName asking for the name of the related table, or the actual name of the relationship as it was set in ArcGIS Pro? I think I'm running into an issue with just that first line.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 18:15:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-for-pop-up/m-p/1405945#M58477</guid>
      <dc:creator>Tiff</dc:creator>
      <dc:date>2024-04-04T18:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression for pop-up</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-for-pop-up/m-p/1405966#M58479</link>
      <description>&lt;P&gt;It uses the relationship name that's set up in ArcGIS Pro&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 18:39:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-for-pop-up/m-p/1405966#M58479</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-04-04T18:39:46Z</dc:date>
    </item>
  </channel>
</rss>

