Issue- New Map Viewer Arcade- Arcade Expression Only Relies on Visible Fields in Popup

858
5
03-01-2022 07:22 AM
Amanda__Huber
MVP Regular Contributor

When using the Popup "Field List", arcade expressions rely directly on the visibility of the fields in the Field List. If a field in the popup field list is hidden, the arcade expression doesn't show data. 

Mounting Style has a simple 

Amanda__Huber_0-1645111580025.png

 

Arcade: 

Amanda__Huber_1-1645111608398.png

If turned off- arcade is empty.

Amanda__Huber_2-1645111715583.pngAmanda__Huber_3-1645111733616.png

 

5 Replies
jcarlson
MVP Esteemed Contributor

I'm unable to replicate this. I can have a single field visible in my list, but have an Arcade element that returns every field for a given feature, regardless of the other fields' visibility in the popup. Any chance your data is public and I could test the same expression?

jcarlson_0-1646151591901.png

Also, why not just use Arcade to build your fields list using the template in the expression builder? Just stick your expression up above the return and call those variables into the field list's attributes.

var c1 = DomainName($feature, 'MountingStyle')
var c2 = $feature['Mounting_style_other']

var x = Concatenate([c1, c2], ' - ')

return {
    type: 'fields',
    //title: '', 
    //description : '',
    fieldInfos:  [
        {fieldName: "MountingStyleConcat" },
        {fieldName: "att2" },
        {fieldName: "att3" }
    ],
    attributes : {
        MountingStyleConcat : x,
        att2 : 3,
        att3 : 4
    }
}

 

- Josh Carlson
Kendall County GIS
0 Kudos
Amanda__Huber
MVP Regular Contributor

Hi Josh, 

Unfortunately no, our data isn't public. I think I may see where our workflows differ. Turn on the visibility of the single arcade expression in the "Fields List" (you should have two items in the field list). Now turn off the field coming from your data (object ID may not be a true test). This is where we see the Arcade expression empty, even though there's attributes in the field it's dependent on. Therefore it's the field visibility that's the issue. 

Alternatively if you want to compare workflows, add two more fields, concatenate the fields like I did, then follow the workflow above. 

 

Best, 

Amanda

0 Kudos
jcarlson
MVP Esteemed Contributor

Well I'll be. When I add the expression to the Field List object, it indeed needs the other field to be visible.

I stand by my initial suggestion of moving the entire Field List into an Arcade element, as this issue does not occur there.

- Josh Carlson
Kendall County GIS
0 Kudos
Amanda__Huber
MVP Regular Contributor

Hi Josh, 

Thanks for your workaround suggestion (instead I just turned off my arcade expressions instead). Ideally we would like this to work or be resolved by Esri staff. 

Thanks, 

Amanda

0 Kudos
MAmbrosini
New Contributor II

Has there been any solution to this? I am having the same issue.

0 Kudos