Arcade Expression Works in Pro Pop-Up, but not in Portal Pop-Up

1414
4
12-16-2019 07:50 AM
AmyRoust
Occasional Contributor III

For context, I'm using Enterprise 10.7.1 and Pro 2.4.2.

I have a feature class joined one-to-one with a table. Both are in enterprise databases (built on SQL Server 2016, 64 bit). The feature class has the shape, the table has the data that I want to display in the pop-ups. The symbology is based on a custom Arcade expression, which works great in Pro and in a Portal web map.

Here's my problem: I have a custom expression set up to calculate the percentage of each political party. Here is the expression for Democrats:

round((($feature['DBName.User.RegisteredVoterCount.DEMOCRATIC']/$feature['DBName.User.RegisteredVoterCount.TOTAL'])*100),1)

(Note that I have replaced the name of the database with "DBName" and the user name with "User" in the syntax above.)

It works great in the Pro pop-up:

I published it as a Map Image Layer to Portal. All of the expressions came through.

It works great when I test it in the custom expression builder in the Portal web map:

But when I add it into the pop-up:

The value doesn't display:

OK, fine. So I publish it as a Feature Layer and turn off editing capabilities. Now my custom Arcade symbology and my pop-ups don't work.

My leading suspect is the join: does anyone know if Portal Arcade has problems with joins?

0 Kudos
4 Replies
XanderBakker
Esri Esteemed Contributor

Hi Amy Roust ,

There is something that I noticed about the way you reference the Arcade expressions in the custom HTML pop-up. One expression that does not work is addressed using the index "{expression/expr0}" the other that does work is referenced using the name "{expression/MayorityParty}". How did you add the arcade expression to the custom HTML? Did you type it in or use the "+" sign?

I assume you are not using clustering, right?

The join might produce problems, but possibly it is not necessary to publish the join (depending the type of join you used). In Arcade you can reference other layers and tables in the same datastore or in the same map or even using the portal id using the FeatureSetBy* functions in Arcade (those should be available in Enterprise 10.7.1). What information is joined?

0 Kudos
AmyRoust
Occasional Contributor III

The {expression/MajorityParty} came from the settings in ArcGIS Pro. I published the layer using the Share as Web Layer tool, and since I had the option to create an alias in Pro, I did. There does not appear to be a spot in the Portal configuration dialogue box to specify an alias for custom expressions. With my first attempt, I published all of the custom expressions (including the one that is causing me problems) directly from Portal. When they weren't working, I deleted them and recreated them manually in the Portal web map to see if there was a bug in their transfer from Pro to Portal.

I'm not sure what clustering is within the context of this discussion -- Xander, can you clarify what you're asking?

I didn't think about using that new functionality to call the table without actually putting it into my map. I will play around with that and see if I get better results. Thank you for that suggestion!

0 Kudos
AmyRoust
Occasional Contributor III

Ready for this? I just went back into my web map to experiment with the FeatureSetBy functionality … and the pop-ups are working properly today. I left the map set up with the layer exactly as I published it from Pro and discarded all of my tinkering. It's working exactly as designed. 

If anyone can explain that, you are a better man/woman than I!

XanderBakker
Esri Esteemed Contributor

Hi Amy Roust ,

Let me first say that I am happy to hear that it is working now and I hope that it will continue to work. I don't think I am a better man/woman, since I can't give you an decent explanation, but sometimes things simply work, although "nothing" changed. I assume there was no reboot of any of the desktops, servers or services used in this process, right?

In regards of the question you posted earlier:

I'm not sure what clustering is within the context of this discussion -- Xander, can you clarify what you're asking?

I was referring to clustering in the web map, as described here: Configure clustering—Portal for ArcGIS | ArcGIS Enterprise  However, your answer makes me believe that you aren't using this feature, so that question became irrelevant.

edit: you mentioned that you experimented with the FeatureSetBy* functions, but you didn't change anything, right? If you have any questions about using these functions, just post them here and I will provide some examples of them.

0 Kudos