Unable to use Arcade expressions in Scene Viewer popups?

1244
8
Jump to solution
04-19-2023 05:47 AM
GIS_Weasel
New Contributor III

Is it possible to author Arcade expressions using Scene Viewer on ArcGIS Online? I can't find clear reference to it anywhere.

I can open (2D) layers in Scene Viewer which have previously been configured with Arcade display expressions, and they refer ro "expression/expr0", but I cannot find any method of creating or managing Arcade expressions in the Scene Viewer interface. It can be done in Map Viewer (and Classic).

I need to do this in Scene Viewer, as I want to configure an Arcade expression for a popup within a 3D scene.

Scene viewer popup config:

GIS_Weasel_0-1681908272765.png

Map viewer config (with "Attribute expressions" button):

GIS_Weasel_2-1681908353016.png

 

 

Tags (2)
0 Kudos
2 Solutions

Accepted Solutions
GianlucaMiele1
Esri Contributor

Thanks @GIS_Weasel 

The "Attcahment viewer" is a valid choice when it comes to displaying feature attachments. From what I can tell it wouldn't address the requirement to not need to add additional attributes to the feature class/layer, though.

Arcade was my target to give a rich output in the popup dialog, without having to add in superfluous attributes into a feature class. I need to display an image inline whose location is derived from another field; I would also like to style some custom HTML by colour according to other attribute values.

ArcGIS Pro supports configuring Popups leaveraging the arcade editor capabilities. Did you try to configure Popups on Scene Layers in ArcGIS Pro and then share it to your ArcGIS Online environment to read them in Scene Viewer?

Pinging @Russell, and @oevans_storymaps  for your additional findings and questions reg. StoryMaps and Hub:

I have also investigated the scripting capabilities (via the Python API) of StoryMap and Hub to achieve this, but wasn't able to get a satisfactory output. I had hoped to create a Hub site with pages for each feature in a feature class, a little auto-generated text, and a Scene centered on the feature - but the update_layout method is essentially undocumented, and the pages created programmatically have a habit of disappearing! See below...


Gianluca Miele | Senior Product Engineer Web 3D
Esri

View solution in original post

0 Kudos
AriIsaak1
New Contributor III

Hello Jasmine,

Yes, I tried it out. It works great. So easy to pass more information to the client if they want it. Thank you for making it happen.


View solution in original post

0 Kudos
8 Replies
GianlucaMiele1
Esri Contributor

Thanks for your request @GIS_Weasel 

This is in our backlog but not yet planned for a release. 
Could you please share the use case(s) you are trying to solve? Specifically, why is it crucial to your use case(s), that arcade expressions can be configured within Scene Viewer?  This helps us to prioritize our backlog.

Gianluca Miele | Senior Product Engineer Web 3D
Esri
0 Kudos
GIS_Weasel
New Contributor III

@GianlucaMiele1- thanks for the response. This turned out to be a long reply but I hope there's something useful for you.

Arcade was my target to give a rich output in the popup dialog, without having to add in superfluous attributes into a feature class. I need to display an image inline whose location is derived from another field; I would also like to style some custom HTML by colour according to other attribute values.

This would then be pulled through into a basic Experience Builder project, but also available to the generic viewer for users preferring that. It is also my preference to keep things simple, much as the Experience Builder can sometimes be shoehorned into a working example - it's not IMO elegant or compatible enough just yet, and I find designing to a fixed screen size a hard sell when we've been responsive throughout our time with Web App Builder.

I would state however that the need for this is as another workaround - actually I've tried many ways of doing this using the product stack and none have yet been acceptable.

At the most basic level of requirement, I have a 3D dataset and want to view an associated image (or images) for a given feature. It needs to be automated, so no manual configuration of StoryMap or Hub or whatever. Can script where necessary, don't want to build and maintain a custom web app.

The "Attachment viewer" template doesn't work with 3D scenes, which would be the quickest and easiest win. If that suppoted Scenes, it would cover 80% of our requirement, and if I could use Arcade in the popup that would be 100% - job done.

I have also investigated the scripting capabilities (via the Python API) of StoryMap and Hub to achieve this, but wasn't able to get a satisfactory output. I had hoped to create a Hub site with pages for each feature in a feature class, a little auto-generated text, and a Scene centered on the feature - but the update_layout method is essentially undocumented, and the pages created programmatically have a habit of disappearing! See below...

script_disappearing.gif

Many thanks.

0 Kudos
GianlucaMiele1
Esri Contributor

Thanks @GIS_Weasel 

The "Attcahment viewer" is a valid choice when it comes to displaying feature attachments. From what I can tell it wouldn't address the requirement to not need to add additional attributes to the feature class/layer, though.

Arcade was my target to give a rich output in the popup dialog, without having to add in superfluous attributes into a feature class. I need to display an image inline whose location is derived from another field; I would also like to style some custom HTML by colour according to other attribute values.

ArcGIS Pro supports configuring Popups leaveraging the arcade editor capabilities. Did you try to configure Popups on Scene Layers in ArcGIS Pro and then share it to your ArcGIS Online environment to read them in Scene Viewer?

Pinging @Russell, and @oevans_storymaps  for your additional findings and questions reg. StoryMaps and Hub:

I have also investigated the scripting capabilities (via the Python API) of StoryMap and Hub to achieve this, but wasn't able to get a satisfactory output. I had hoped to create a Hub site with pages for each feature in a feature class, a little auto-generated text, and a Scene centered on the feature - but the update_layout method is essentially undocumented, and the pages created programmatically have a habit of disappearing! See below...


Gianluca Miele | Senior Product Engineer Web 3D
Esri
0 Kudos
GIS_Weasel
New Contributor III

Hi Gianluca,

you're right, I hadn't wanted to add attachments, but it's not a major problem - and if the facility were there in the Attachment Viewer app I'd probably just go for it. The whole point of this is it needs to be a minimal maintenance, out-of-the-box, pretty, public facing app.

I hadn't considered adding the popup configuration in Pro - I'll test that shortly, but I expect that would resolve our issue. It might be worth highlighting that in the documentation somewhere, because it's an easy and accessible solution for Pro users. In the end we've added an extra field into the feature class corresponding to a file location on an external web server. This works in the standard Scene Viewer and is pulled through to any other consuming app.

Thank you also to @OwenGeo for responding re: Story Maps. Personally, I really enjoy using Story Maps to guide users through content and we've used it here for a number of successful campaigns. As you say, the Map Tour isn't really appropriate given the limitations on feature type. I hope to be able to build some decent apps based around scripting Story Maps in future when there's more time.

In the end, my current Experience Builder app - to demo at the UK user conference, as part of a related presentation - is passable, although I'm now butting right up against another somewhat frustrating gotcha with Scene Layers. It's not able to zoom to a selected item in a 3D layer from an associated widget (referenced here: https://community.esri.com/t5/arcgis-experience-builder-questions/unable-to-zoom-to-selected-feature...).

Kind regards.

OwenGeo
Esri Notable Contributor

At the most basic level of requirement, I have a 3D dataset and want to view an associated image (or images) for a given feature. It needs to be automated, so no manual configuration of StoryMap or Hub or whatever. Can script where necessary, don't want to build and maintain a custom web app.

Anything you can show in a web scene or web map should appear in a StoryMap, so if you can create it in the scene viewer or map viewer you should be able to view it in a StoryMap.

I don't think there is any StoryMap block that will provide a different or alternative way to support your workflow, except possibly the map tour. Map tour has a 3D mode that lets you view a feature service with image attachments, but it is a simple block. The primary layer must be a point layer, and it only supports adding other 2D layers as reference (and it sounds like you have 3D data you need to include).

Owen Evans
Lead Product Engineer | StoryMaps
0 Kudos
AriIsaak1
New Contributor III

The "solution" here doesn't really solve the problem. "Arcade is powerful because of its portability with other apps across the ArcGIS system." I was surprised to learn that SceneViewer isn't listed as a supported product, If Esri is really committed to Arcade and 3D then It really should be.

0 Kudos
JasmineDu
Esri Contributor

Hi @AriIsaak1 ,

The good news is that Scene Viewer supports Arcade in the latest October release. Do give it a try and let us know your thoughts! https://www.esri.com/arcgis-blog/products/arcgis-online/3d-gis/whats-new-in-scene-viewer-oct-2023/

Best,

Jasmine

Product Manager – Scene Viewer | jdu@esri.com

0 Kudos
AriIsaak1
New Contributor III

Hello Jasmine,

Yes, I tried it out. It works great. So easy to pass more information to the client if they want it. Thank you for making it happen.


0 Kudos