Select to view content in your preferred language

Calculate attribute based on active indoors floor filter level

60
0
Monday
Labels (2)
ChristopherJStrong
New Contributor III

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.

0 Kudos
0 Replies