In ArcGIS Field Maps, is there a way to log the current location of a mobile device when a record is added to a related inspection table ? The goal is not to track the asset’s current geometry, but rather to verify the user’s location at the time of record creation. This would serve as proof that the user was indeed at the specified location.
Hi @DhowalDalal_EsriUK . Yes, you can collect the current geometry using the Arcade function Geometry() on your field. For your X field, you would add this expression:
Round(Geometry($feature).X, 6)
Then do the same for your Y field, switching the X for a Y in the expression. The example here is rounding your X coordinate to 6 places, you can change that 6 to another number to fit your needs.
Thanks for the reply @KerriRasmussen - just to check i`ve understood the steps correctly
1 - Create two new fields in the related table to capture X and Y
2 - Calculate geometry using Arcade expression above.
Question - will this use the GPS location from the device? Thanks.
@DhowalDalal_EsriUK Yes, you are correct, create the fields then add the Arcade expressions to those fields to calculate the geometry.
Yes, it will use the GPS location of the device.
Thanks @KerriRasmussen - we are going to test this. Will report back.
Isn't the Geometry($feature) function just going to return the geometry of a feature?
The scenario I have is, I have a point feature layer that contains assets, I have a related inspection table that users complete when carrying out cyclical operation to the asset, I already have arcade expressions in attribute rules that copies the x and y to fields on my inspection table so that we have a record of the location of the assets when it was inspected.
What we want to add to this is a method of recording the current location of the user when they are creating an inspection record to prove that they were on site at the time that the inspection was recorded. So some way of grabing the mobile device's current GPS coordinates when the inspection record is created.
We did have a suggestion to make the inspection table a point feature class and use GPS metadata to capture the user location but I don't see how you could force GPS location and prevent the user manually setting the location of this point layer.
@ShaunGibbins It depends on how you use the geometry function. The example I used above will take the geometry of the point and return the X value for that point.
You can collect the lat/long using the geometry function, but there is also another option. @DhowalDalal_EsriUK this option may also work for you as well.
In Field Maps Designer, if you go into the app settings for your form, select Collection and scroll down to Manual location. There is an option to block manual location, meaning that when the user is entering a point, it will automatically use their GPS location and will not allow the user to manually change their location. One note I should make here is that this is for collecting a point, not for collecting in a related table.
Hi Kerri
Dhowal was posting on our behalf so it's my problem he is trying to find a solution for.
If I change my inspection table to a point feature class and block manual location then this would indeed provide a solution to the dilemma.
Is this setting available in enterprise and if so what version as I am not seeing the option in our 10.8.1 environment.
Hi Kerri, I have a use case for this suggestion but I don't know if it will work out. In my case I have a point feature class that was created using the Create Random Points geoprocessing tool. The points represent areas were soil samples need to be taken for lab analysis. What I want to achieve is, within the field maps app, the option to edit the sampling status from not sampled to sampled (a field in the point FC), to only be visible when the mobile worker is within a certain distance from the point. How would you suggest I go about implementing such functionality. I tried using Geofencing, but due to the large number of points, there was a performance issue with the resulting map on the workers side.
Hi @KevinKamau.
I agree that using geofencing would be problematic with a larger number of points if you were trying to add a geofence around each point. I have another possible solution for you. If you take your current layer (the random point FC) and make that layer read-only and remove the pop-up. Then you add another layer to the map that will be your data collection layer using different symbology. There is a data collection setting in Field Maps Designer (App settings > Collection > Manual location) where you can block manual location entry, basically when a point is created, it will show at the current device location and the user can’t manually move the point. This will show you the location where the sample was collected and you can compare that to the original location on the map to make sure they are within your expected tolerance. If the mobile users only need to collect the point, it’s as easy as hitting submit, otherwise they can add some other data to the form for that point as well. They can see what has been collected and what hasn’t based on the symbology.