Has anyone tried using the pull data to identify the closest point of another dataset to the geopoint and retrieve a value something like the near toolbox function in arcmap.
It's a bit like using the pulldata function and a calculation in one go that takes the current location of the geopoint and calculates the distance to a list of points within a csv file and then returns their site name
thanks
Stu
Solved! Go to Solution.
This looks really great, if I ever have the need again and implement it I promise to post. Thank you for sharing the example!!
Hello @IsmaelChivite ,
After using your script and mimicking the fields in your screenshot, the 'city_json' field returns the feature layer feature service link, and the 'closest_city' field respectively returns a blank. Any idea why this might be happening?
Thanks
@IsmaelChivite Is this still the best way to accomplish the closest feature search? Are there any options for a public survey like the "?distance=" search? Not sure in what order those records are returned or if they could be sorted by distance.
Has anyone else been able to expand on this conundrum? I'm using Survey123 Connect and am trying to pull attribute data from the nearest point to another point that I'm plotting on a survey. I tried the script that @IsmaelChivite posted, but it hasn't populated in the way that I've hoped yet. Any input would be appreciated!
Far from ideal and far from accurate, I currently use the below calculation. Although it does not get the actual nearest point, it does provide an indication of the nearest by limiting the search distance. For our usecase this is sufficient to give an indication of the nearest street name. This is purely to provide an indication, not important for the actual data.
pulldata("@layer", "getValueAt", "attributes.<ATTRIBUTE>", "https://<URL>/arcgis/rest/services/<SERVICE>/FeatureServer/<LAYERID>?distance=25&units=esriSRUnit_Meter", ${GEOMETRY_NAME})
What I use as a better solution is in a web map use an Arcade expression to find the actual nearest feature. Admittedly, I have the advantage we only use Survey123 to get reports which ArcGIS Online users then edit using a web map. So I am lucky I can use Arcade expressions in a Form. That Arcade expression is adapted from From the Smart Editor to Smart Forms.
Frankly, it's great and all we can use AI in Survey123, but we still cannot properly use Arcade expressions and use other coordinate systems in Survey123. I think the priorities are mixed up here..