I would like to access input distance of Near me Widget, needs to display same in another widget using arcade.I tried this and nothing is showing
Arcade isn't a "state manager" for the UI. It’s a data evaluator. If the Near Me widget doesn't explicitly write the "Search Distance" into a field in its output table, Arcade has nothing to read.
Check your Near Me widget settings—make sure "Return distance" is enabled in the results. Once it’s in the data, you can just pull it as a standard field like {Distance} instead of digging through queryParams.
Are you trying to show the maximum search radius allowed, or the actual distance to the closest found object?
There is no option to return search distance, we have approximate distance return.
Stop looking for the "Input" and start looking at the "Output." If the data is on the screen, it’s in the service. Find the field name in the Output Data Source and call that directly.
Are the results you're getting in the Near Me widget coming from a single layer, or are you searching across multiple feature classes?
Yes. I am calling widget_330_output_proximity_5868139358808708-output of the Near me Widget, it is single layer
// 1. Get the first feature from the Near Me output
var fs = $dataSources["widget_330_output_proximity_5868139358808708-output"]
var feature = First(fs)
// 2. Access the distance attribute created by the widget
// Note: This is a dynamic field, not a schema field
var dist = feature.distance
// 3. Return it with formatting
return Text(dist, "#.##") + " miles"
In the Arcade suggestions box, I can see all available functions and properties. However, the issue is that I’m not able to retrieve the data from queryParams.
The previous snippet only displays the distance of the first feature, not the input search distance