Select to view content in your preferred language

Newbie question on Near Me output data

244
5
07-24-2025 12:23 PM
TerrySteege
Emerging Contributor

I am just learning how to use this product and I am having an issue with the Near Me widget's output.

I have a basic project with a map widget, and linked to some data I would like to calculate from.  I am able to click a spot on the map and have the Near Me widget show the closest asset I have to that location.  It shows the data and the Approximate Distance from where I clicked to that asset.  I can then get the distance to populate in a text widget, but when I try to do an expression to multiply that value by say $10 it does not show up.  I assume it is because the output is not numeric due to the "ft" label on the back of the data.  

Does anyone know how I can achieve this type of functionality?

Thank you in advance with any ideas.

Terry S

0 Kudos
5 Replies
CodyPatterson
MVP Regular Contributor

Hey @TerrySteege 

I think you're on the right track with the not being able to multiply due to it being text. Typically to perform math operations, they need to be integers, if you're using Arcade, you may be able to convert it to an integer like this:

Number("string value")

This would convert it to an integer for the purposes of math, you could assign it to a variable to be used as well!

Cody

VenkataKondepati
Occasional Contributor

Hi @TerrySteege,

The issue is the distance includes “ft,” so it's treated as a string. You’ll need to extract the number first before multiplying.

If you're using Experience Builder, try an expression that splits the string and converts it to a number. Something like:

var d = Split($feature["Approximate Distance"], " ")[0];
return Number(d) * 10;

Regards,

Venkat

TerrySteege
Emerging Contributor

Did you have to turn on a setting to see Arcade as an option in Exp Builder?  I do not have the ability in my EB to add Arcade expressions for some reason.  

 

0 Kudos
AzizaParveen1
Esri Contributor

Hi @TerrySteege ,

Approximate distance is string, I will log an enhancement request to change it to numeric. In the mean time you can use arcade expression to  extract and calculate math operation as Venkata suggested.

Thanks for reporting this.

Aziza

TerrySteege
Emerging Contributor

That will be awesome, thank you!

0 Kudos