Select to view content in your preferred language

Calculate attribute based on active indoors floor filter level

547
2
08-26-2024 01:20 PM
Labels (2)
ChristopherJStrong
Occasional Contributor

Has anyone been able to figure out how to auto-calculate a field based on the active floor in a floor-aware webmap?  I'm trying to grab a room number and floor number from my indoors layers, and insert them into newly created features using ArcGIS Online Web Viewer and Field Maps.

I've tried using this arcade script (below), but it's ignoring the floor filter and instead pulling the attribute from the first intersecting layer it finds.  I'm applying this script to a field calculation in the Web Map form for new Electrical Panels.  I also have layers for Rooms (Units) and Levels in the same webmap.

var roomnum = FeatureSetByName($map, "Units", ['NAME'])
var roomattribute= First(Intersects($feature, roomnum))

if (!IsEmpty(roomattribute)) {
    return variable2['NAME']
} else {
    return null
}
 

In Field Maps, it looks like inserting the floor number is default behavior, but actually removes the Floor field from the form in the same webmap for users trying to edit on a desktop.

Would love suggestions on how to do this, if it's possible.  I've seen some other posts recommend using pre-built templates for each level, but this would only work for grabbing the floor level (and not the room number).  It's also very clunky/inefficient to preload up to 14 templates per layer, that a user now has to sort through.

2 Replies
czahn2
by
Emerging Contributor

Hello! We are having the same issue. Did you ever figure this out?

Tags (2)
0 Kudos
GISMaryWagner
Occasional Contributor

We are having this issue as well and it is pretty frustrating - also the difference in functionality across the platforms is confusing as well.  Here is what I have learned so far (sharing in case I am missing something...)

The intersecting Arcade expression will not function properly to collect the short floor number (1, 2, etc), room number or Unit ID because the widget appears to be a pseudo filter (?).

If editing right in the web map Level ID can not be edited and is not auto populated.  An Arcade expression can be applied, but only before the layer is added as floor aware.   The intersection arcade expressions ignore what the floor filter displays.

If editing in Field Maps, the Level ID is successfully populated when adding/updating a new feature (by default - no arcade needed) but the arcade expressions to populate room ids etc are not honored. 

In Experience Builder, in the floor filter settings, the floor filter can be set up to actually filter the data.  The editing template set up (in the web map) will work, but again the Level ID arcade needs to be set up BEFORE adding it as an indoors aware layer.  Also I found that if trying to use the Levels polygon to populate level ID, that will not work even with the settings.  I was able to successfully use the Units polygon for the Level ID. 

It would be nice to have the settings like ExB right in the web map so that it can be configured for multiple applications.

Anyways just adding this as I've spent my entire day trying all these things to get staff out and collecting assets.  Was hoping for field maps, but it seems I'm stuck with ExB for now.

Mary

0 Kudos