Hello all,
I am using ArcGIS Online, and has 2 layers in my map.
1) USA Census States (Living Atlas), with so many fields, and our interest is in "Population" field
2) Points (Hosted Feature Layer), with a Test field
My objective is to create points in some states and auto-populate the test field with its Population from USA Census States layer in the map.
I tried using Arcade in smart forms, but seems like there is some roadblock. Either this is not supported yet on AGOL or I am doing something wrong?
Arcade I used:
// Access the USA States polygon layer with population information
var states = FeatureSetByName($map, "USAStatesLayer", ["population_field"]);
// Find the first USA state polygon that contains the current point
var intersecting_state = First(Filter(states, Contains(Geometry($feature), Geometry($layer))));
// If an intersecting state polygon is found, return its population value
if (!IsEmpty(intersecting_state)) {
return intersecting_state["population_field"];
} else {
return "No Population Data";
}I have also tried using Intersect function, but fails.
Is there any other way of achieving this? My end goal is to use this method for field maps data collection, so that when a point is collected by field workers, the population data is automatically filled in the collected records.
Any help on this would be highly appreciated!!