I am trying to add an XY coordinate of the center of a polygon to the list.
Currently I have a WebMap that is filtered using the dashboard and another tab of the WebApp so that they can find the project they need and then open the other tab and edit the attribute.
As a way to help locate the project between he two map tabs, I want to add an XY to the list so it is easy to find the projects between the two maps.
I have another ID they should use to search but I wanted to figure out the arcade for the XY.
Any help would be amazing!
You can use the Centroid function to get the center point for a polygon.
var thePoint = Centroid(Geometry($feature));
var output = `x: ${thePoint.x}, y: ${thePoint.y}`
Thank you, What do you think I have setup wrong?
My code uses template literals , which uses the back tick (`) instead of the regular quote (').
Yes, I am using regular single quotes (') here
If you use regular quotes, then the line would like this
var output = 'x: ' + thePoint.x + ', y: ' + thePoint.y
Well dang, now I'm really confused. That's not structured anything like the original?
Take a look at the page on template literals. The two examples I provided give the same output.
Oh, I'm sorry. I follow you. I thought I was to remove the back tick. I thought that was the wrong character because this it the output that I had with back ticks.
"Unable to execute arcade script"
I had overlooked that the Geometry bundle is not available in the Dashboard list formatting profile, most likely for performance gains. I'm looking into a way to add that to your data as you load it into Dashboard