<?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 within Dashboard Category Selector in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-within-dashboard-category-selector/m-p/1370298#M56858</link>
    <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I'm trying to create a category selector in Dashboard that will have an option of; Cancelled, Upcoming, Pre-decisional, Live and Complete. Due to wanting this process done automatically with minimal input from end users the 'status' field currently has; Pre-decisional, Cancelled and Other - so end users will change from Pre-decisional to either Cancelled or other depending on approval - but once approved we want that to be the last time the data needs to be edited manually. I was able to get arcade working for the symbology for the data layers using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;if ($feature.status == 'Cancelled') {
    return 'Cancelled'
}
else if ($feature.status == 'Pre-decisional') {
    return 'Pre-decisional'
}
else if ($feature["start_date"] &amp;lt;= Now() &amp;amp;&amp;amp; $feature["end_date"] &amp;gt;= Now()) {
    return 'Live';
}
else if (Now() &amp;gt; $feature["end_date"]) {
    return 'Complete'
}
else if (Now() &amp;lt; $feature["start_date"]) {
    return 'Upcoming'
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried applying the same logic to the category selector in Dashboard using the below script. In the edit data expression page there are no errors, but when i select done i get the error "Unable to execute Arcade script".&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var portal = Portal("portal URL")

var points = FeatureSetByPortalItem(portal, "item ID", 0, ['status', 'start_date', 'end_date'])


if ($points.status == 'Cancelled') {
    return 'Cancelled'
}
else if ($points.status == 'Pre-decisional') {
    return 'Pre-decisional'
}

else if ($points["start_date"] &amp;lt;= Now() &amp;amp;&amp;amp; $points["end_date"] &amp;gt;= Now()) {
    return 'Live';
}
else if (Now() &amp;gt; $points["end_date"]) {
    return 'Complete'
}
else if (Now() &amp;lt; $points["start_date"]) {
    return 'Upcoming'
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Jan 2024 22:42:19 GMT</pubDate>
    <dc:creator>MichaelFowler1</dc:creator>
    <dc:date>2024-01-15T22:42:19Z</dc:date>
    <item>
      <title>Arcade within Dashboard Category Selector</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-within-dashboard-category-selector/m-p/1370298#M56858</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I'm trying to create a category selector in Dashboard that will have an option of; Cancelled, Upcoming, Pre-decisional, Live and Complete. Due to wanting this process done automatically with minimal input from end users the 'status' field currently has; Pre-decisional, Cancelled and Other - so end users will change from Pre-decisional to either Cancelled or other depending on approval - but once approved we want that to be the last time the data needs to be edited manually. I was able to get arcade working for the symbology for the data layers using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;if ($feature.status == 'Cancelled') {
    return 'Cancelled'
}
else if ($feature.status == 'Pre-decisional') {
    return 'Pre-decisional'
}
else if ($feature["start_date"] &amp;lt;= Now() &amp;amp;&amp;amp; $feature["end_date"] &amp;gt;= Now()) {
    return 'Live';
}
else if (Now() &amp;gt; $feature["end_date"]) {
    return 'Complete'
}
else if (Now() &amp;lt; $feature["start_date"]) {
    return 'Upcoming'
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried applying the same logic to the category selector in Dashboard using the below script. In the edit data expression page there are no errors, but when i select done i get the error "Unable to execute Arcade script".&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var portal = Portal("portal URL")

var points = FeatureSetByPortalItem(portal, "item ID", 0, ['status', 'start_date', 'end_date'])


if ($points.status == 'Cancelled') {
    return 'Cancelled'
}
else if ($points.status == 'Pre-decisional') {
    return 'Pre-decisional'
}

else if ($points["start_date"] &amp;lt;= Now() &amp;amp;&amp;amp; $points["end_date"] &amp;gt;= Now()) {
    return 'Live';
}
else if (Now() &amp;gt; $points["end_date"]) {
    return 'Complete'
}
else if (Now() &amp;lt; $points["start_date"]) {
    return 'Upcoming'
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2024 22:42:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-within-dashboard-category-selector/m-p/1370298#M56858</guid>
      <dc:creator>MichaelFowler1</dc:creator>
      <dc:date>2024-01-15T22:42:19Z</dc:date>
    </item>
  </channel>
</rss>

