Select to view content in your preferred language

Floor-aware hosted feature layer

199
6
Jump to solution
a week ago
mshanaghan
Frequent Contributor

Hi all.

I am trying to map indoor security cameras as a floor-aware hosted feature layer in my enterprise portal. I have a complete Indoors dataset (Facilities, Levels, Units, Details) that I want this camera layer to sit on top of. I want the editing of the camera dataset to be done in experience builder.

I thought that if the camera layer had a “LEVEL_ID” field, this field would be auto-populated based on where the editor placed the point (the active floor in the floor filter). This does not seem to be the case. It seems I must manually enter (copy/paste) the level ID string in order for the asset to be floor aware.

When I tried to set up a calculation rule within the “Configure Editing” form in Map Viewer, the Level ID field is not available for me to write a rule for since it's being used as the floor field for the asset layer! See pics below.

mshanaghan_0-1766084118659.png

 

 

mshanaghan_1-1766084118659.png

 



Does the camera layer need to be an enterprise feature service in order for the level ID to be auto-populated?

0 Kudos
1 Solution

Accepted Solutions
GauravJobanputra
Esri Contributor

@VenkataKondepati thanks for the detailed response.

@mshanaghan to add to the above response, refer to this section of the documentation for a sample Arcade expression to use for your Camera layer to enable auto-population of LEVEL_ID. Use it in conjunction with the other new settings introduced in the Floor-Fiter widget in the recent releases. If LEVEL_ID is not availavble to you when trying to set the expression then you will need to perform a workaround by removing the Camera layer from the floor-aware settings in the web map, save the web map, add the expression to the layer and add it again to the floor-aware settings in the web map.

View solution in original post

0 Kudos
6 Replies
VenkataKondepati
Regular Contributor

No, switching to an Enterprise Feature Service won't fix this automatically. The "active floor" in a widget doesn't naturally "talk" to the database to inject values—you have to bridge that gap with logic.

Here is how to fix it:

  • Use an Arcade Attribute Rule: Instead of trying to force the UI to do it, set a Calculation Rule on your Camera layer. Use a Spatial Intersect so that whenever a camera is dropped, it looks "down" at your Levels polygon layer and pulls the LEVEL_ID automatically. This works in the background regardless of your Experience Builder settings.

  • The "Hidden Field" Issue: The reason you can't see the field in the "Configure Editing" form is that Map Viewer protects "Floor Fields" from manual tampering. You need to apply the Arcade rule via the Data Tab of the layer's Item Details page or through ArcGIS Pro before publishing.

  • Experience Builder Limitation: Currently, the Edit widget doesn't "listen" to the Floor Filter widget's state. Using the spatial intersection rule mentioned above is the standard "Indoors" way to ensure your data stays clean.

mshanaghan
Frequent Contributor

Thank you for this thoughtful response. I did not know about this "Calculate" option in the Data tab of the item page! This will be helpful in the future. 

mshanaghan_0-1766147935090.png

I've never gotten attribute rules to "stick" with a layer when published from Pro if not in an enterprise geodatabase. I'd like to hear if you've ever done this successfully with regular hosted feature layers.

0 Kudos
GauravJobanputra
Esri Contributor

@VenkataKondepati thanks for the detailed response.

@mshanaghan to add to the above response, refer to this section of the documentation for a sample Arcade expression to use for your Camera layer to enable auto-population of LEVEL_ID. Use it in conjunction with the other new settings introduced in the Floor-Fiter widget in the recent releases. If LEVEL_ID is not availavble to you when trying to set the expression then you will need to perform a workaround by removing the Camera layer from the floor-aware settings in the web map, save the web map, add the expression to the layer and add it again to the floor-aware settings in the web map.

0 Kudos
mshanaghan
Frequent Contributor

This works! Thank you very much Gaurav.

Do you think if I changed the code above to include "editType == UPDATE", the calculation would apply when moving existing features too?

0 Kudos
MollyE
by
Frequent Contributor

I just tested this out on a map that is using this same method but to calculate the UNIT_ID, and changed the editType to UPDATE and it does work.

The only limitation to it is that if you wanted to move a feature from somewhere on level 1 to level 2, you would have to use the floor filter widget to switch floors on the map, which would make the feature you are editing (and currently has a level ID on floor 1) disappear, so therefore you cannot move it. 

EDIT: Another note, if you plan to have users add new points and update current ones, you'd need to have both edit types in the expression.

MollyE_0-1766172054598.png

 

mshanaghan
Frequent Contributor

Thanks Molly. I also tried it and it's working great. I did notice that I had to include the "Levels" layer to the "Additional layers" section in the map properties of the web map in order for the calculation to apply.

mshanaghan_0-1766508499778.png

 

0 Kudos