<?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: Pop up Arcade expression script working in ArcGIS Pro but not working in ArcGIS Online in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/pop-up-arcade-expression-script-working-in-arcgis/m-p/1611947#M64637</link>
    <description>&lt;P&gt;You can use the $map variable in AGOL if you're referring to a featureset in the current map. If featureset is not in your map, then you have to retrieve it using FeatureSetByPortalItem.&lt;/P&gt;</description>
    <pubDate>Tue, 06 May 2025 13:31:36 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2025-05-06T13:31:36Z</dc:date>
    <item>
      <title>Pop up Arcade expression script working in ArcGIS Pro but not working in ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/pop-up-arcade-expression-script-working-in-arcgis/m-p/1611869#M64632</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I have two polygon layers - buildings and neighborhood zones. I need in pop up to display whether a building is located in those zones or is not.&lt;/P&gt;&lt;P&gt;I use this Arcade expression and it works in ArcGIS Pro:&lt;/P&gt;&lt;P&gt;var zones = FeatureSetByName($map, 'NB_zones', ["*"]);&lt;BR /&gt;var intersects = Intersects($feature, zones);&lt;BR /&gt;var firstFeature = First(intersects);&lt;/P&gt;&lt;P&gt;if (firstFeature != null) {&lt;BR /&gt;return "Building is in the zone";&lt;BR /&gt;} else {&lt;BR /&gt;return "Building is not in the zone";&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;So, this expression perfectly works in ArcGIS Pero but not working in ArcGIS Online Mapviewer.&lt;/P&gt;&lt;P&gt;What's wrong with the expression in AGOL and must be used (written) instead?&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2025 07:14:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/pop-up-arcade-expression-script-working-in-arcgis/m-p/1611869#M64632</guid>
      <dc:creator>LIEPAJABUILDINGBOARD</dc:creator>
      <dc:date>2025-05-06T07:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: Pop up Arcade expression script working in ArcGIS Pro but not working in ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/pop-up-arcade-expression-script-working-in-arcgis/m-p/1611933#M64634</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/571679"&gt;@LIEPAJABUILDINGBOARD&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;So this issue with pro vs AGO is that accessing the feature is slightly different. In AGO, or any other portal, you will need to access the feature using &lt;A href="https://developers.arcgis.com/arcade/function-reference/portal_functions/#portal" target="_blank" rel="noopener"&gt;Portal&lt;/A&gt; then &lt;A href="https://developers.arcgis.com/arcade/function-reference/portal_functions/" target="_blank" rel="noopener"&gt;FeatureSetByPortalItem&lt;/A&gt;.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var arcgisPortal = Portal('https://www.arcgis.com');
var features = FeatureSetByPortalItem(arcgisPortal, '7b1fb95ab77f40bf8aa09c8b59045449', 0, ['Name', 'Count'], false);&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 06 May 2025 12:56:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/pop-up-arcade-expression-script-working-in-arcgis/m-p/1611933#M64634</guid>
      <dc:creator>RPGIS</dc:creator>
      <dc:date>2025-05-06T12:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Pop up Arcade expression script working in ArcGIS Pro but not working in ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/pop-up-arcade-expression-script-working-in-arcgis/m-p/1611935#M64635</link>
      <description>&lt;P&gt;Need to adjust your return to be an object I believe:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if (firstFeature != null) {
return { type : 'text', text : 'Building is in the zone'}
} else {
return { type : 'text', text : 'Building is not in the zone'}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2025 12:59:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/pop-up-arcade-expression-script-working-in-arcgis/m-p/1611935#M64635</guid>
      <dc:creator>JohnEvans6</dc:creator>
      <dc:date>2025-05-06T12:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Pop up Arcade expression script working in ArcGIS Pro but not working in ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/pop-up-arcade-expression-script-working-in-arcgis/m-p/1611944#M64636</link>
      <description>&lt;P&gt;If this a simple text element, you don't need to return an object. For an Arcade element (or a chart), you will need to return an object.&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2025 13:25:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/pop-up-arcade-expression-script-working-in-arcgis/m-p/1611944#M64636</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-05-06T13:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Pop up Arcade expression script working in ArcGIS Pro but not working in ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/pop-up-arcade-expression-script-working-in-arcgis/m-p/1611947#M64637</link>
      <description>&lt;P&gt;You can use the $map variable in AGOL if you're referring to a featureset in the current map. If featureset is not in your map, then you have to retrieve it using FeatureSetByPortalItem.&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2025 13:31:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/pop-up-arcade-expression-script-working-in-arcgis/m-p/1611947#M64637</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-05-06T13:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Pop up Arcade expression script working in ArcGIS Pro but not working in ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/pop-up-arcade-expression-script-working-in-arcgis/m-p/1611968#M64638</link>
      <description>&lt;P&gt;As far as I know the spec changed in 1.16 according to the docs and you have to return a dictionary if you use Arcade:&amp;nbsp;&lt;A href="https://developers.arcgis.com/arcade/profiles/popup-element/" target="_blank" rel="noopener"&gt;Popup Element | ArcGIS Arcade | Esri Developer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;At least I have to in whatever version I'm running. If i one-liner return 'This is a test', my popup is blank.&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2025 14:14:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/pop-up-arcade-expression-script-working-in-arcgis/m-p/1611968#M64638</guid>
      <dc:creator>JohnEvans6</dc:creator>
      <dc:date>2025-05-06T14:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: Pop up Arcade expression script working in ArcGIS Pro but not working in ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/pop-up-arcade-expression-script-working-in-arcgis/m-p/1611989#M64642</link>
      <description>&lt;P&gt;I'm referring to a text element like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_74057a.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/131616i950D6FBABFAAA0C6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snag_74057a.png" alt="Snag_74057a.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;The expression used in that element just has a text return, not an object return&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_721ec8.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/131615i6495AC05BD2F1178/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snag_721ec8.png" alt="Snag_721ec8.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var label = "This is a test"
return label&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_74974a.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/131617i7E85834C0F4B70F6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snag_74974a.png" alt="Snag_74974a.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2025 14:25:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/pop-up-arcade-expression-script-working-in-arcgis/m-p/1611989#M64642</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-05-06T14:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Pop up Arcade expression script working in ArcGIS Pro but not working in ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/pop-up-arcade-expression-script-working-in-arcgis/m-p/1612076#M64643</link>
      <description>&lt;P&gt;Oh I see it now. I had no idea you could do it that way.&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2025 17:52:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/pop-up-arcade-expression-script-working-in-arcgis/m-p/1612076#M64643</guid>
      <dc:creator>JohnEvans6</dc:creator>
      <dc:date>2025-05-06T17:52:20Z</dc:date>
    </item>
  </channel>
</rss>

