Web AppBuilder Get Coordinates Widget

12-04-2020 12:19 PM
Status: Open
Labels (1)
New Contributor III

I would love to see a simple widget that populates user-specified fields with the coordinates of a point feature layer. Something that looks like this:


The Smart Editor widget can batch calculate the coordinates of features, but it seems there are a lot of hoops to jump through! Not to mention it's a configuration that can only be set up by the author of the application.

Apologies if this idea already exists!


Hi Kathryn,

Thank you for sharing this idea!

Please would you be able to describe more on how you would like to use this widget? What is the problem you are trying to solve? Please provide as many details as possible on your use case so we can consider this capability in future development.

Thank you! 🙂

@AlixVezina , in my position as a DOT GIS Analyst, I set up a lot of datasets in ArcMap that I then publish to AGOL for our contractors and engineers (some who have minimal GIS experience) to take over and manage autonomously both in the office and out in the field.

A common method of identifying places along a road in this industry is with a Mileage Reference Marker + Displacement system, which we can derive using XY data. Unfortunately, I don’t find the existing options of getting coordinates across any of the platforms intuitive at all. It requires a lot of background setup or diving several steps into a widget to update and refresh the geometry. I would prefer a widget equivalent of right-clicking a field in ArcMap and using the Calculate Geometry tool.

For example, we have inspectors go out into the field with an iPad and use ArcGIS Collector to drop points at locations where a roadway needs to be repaired. Then one of our engineers back in the office will export those points to a table using Web AppBuilder and draw up contract plans based on the collected information. After the project is completed, we have a maintenance crew navigate back out to the site and confirm its status. It would be helpful if the engineer could just click a button to fill the coordinate fields so that we could then convert them into Mileage Reference Marker + Displacement units within Web AppBuilder (we have an internal tool developed by our IT office to do this translation). That way, the maintenance crew can easily identify and revisit the area for review.

I’ve used ArcGIS Pro to add GNSS fields to the dataset and then published to our server. This seems to sync well with Collector points that are dropped (it will automatically update these fields when a new point is created), but if I use Web AppBuilder to create a point then the GNSS fields aren’t populated. Going forward, I can configure the Smart Editor widget’s Attribute Actions to automatically update the GNSS fields if a new point is created within Web AppBuilder, but any existing points that were created in Web AppBuilder before I configured the Smart Editor widget won’t update, even if I Edit Geometry. I could also fall back on the Arcade option and use the Geometry function to customize an expression. This would create another field for the coordinates, though, so I’d end up with two sets of fields for Latitude/Longitude. Ultimately, I think more coordinate collection compatibility between Web AppBuilder and Collector would be great.

I’m open to other solutions, as I’m sure it’s quite possible there’s an obvious answer staring me in the face! Thank you for considering this idea!

Hi Kathryn,

Thank you for the details!

There are a couple of approaches that come to my mind based on my understanding: you would like to add coordinates attributes to fields in existing features where that coordinates information is missing. If I did not grasp this right, my suggestions probably won't be useful... so hopefully, this is on track!

Option 1: ArcGIS Pro - You could access your service in ArcGIS Pro and run the Calculate Geometry geoprocessing tool against the coordinate fields you need to populate. In the tool, you will get some coordinates format options. If you don't want to overwrite existing attributes, make sure to select the features where the attribute is Null before running the tool. Be careful, this will edit your service data directly.

Screenshot 2020-12-10 085012.jpg


Option 2: ArcGIS Online - Access the item details page for the feature layer you've published and go to the Data tab. In the table, click the field column you need to update and select Calculate. Choose Arcade - if you have Sync enabled on that layer, you won't be able to choose Arcade.

Screenshot 2020-12-10 090157.jpg

Screenshot 2020-12-10 091247.jpg

Option 3: Smart Editor widget in Web AppBuilder - This option would be in the hands of your end-user and more in line with what you described as "the engineer could just click a button to fill the coordinate fields". 

In the widget configuration, make sure you've configured a Coordinate Attribute Action against the field you need to populate with coordinate attributes. Then, in the General Settings, enable the option "Show Attribute Actions update button". If you need the coordinate attributes to also update when the feature geometry is updated, also enable " Automatically call Attribute Actions after geometry update".

Screenshot 2020-12-10 091741.jpg

Make sure the Smart Editor is set to open when the app loads (one less click for them, I would suggest). When the engineer will click an existing feature, if the attributes are missing, they may click the "Update dynamic feature attributes" button as shown below to trigger the Coordinate Attribute action. If " Automatically call Attribute Actions after geometry update" was enabled in the configuration, they could also simply move the point slightly to get the values or they would have to double-click the "Update dynamic feature attributes" button.

update AA.png

Thank you for this excellent information, @AlixVezina !