Thank you for watching! If you have questions about our products or services, make sure to visit community.esri.com/. Is there a general topic you’d like us to cover in a future video? Let us know in the comments below!
Video was very helpful, thanks! Why don't y'all ever want to use the When() function instead of the IF statement? It's so much more elegant, especially if you have more than one condition to check for. return When(!IsEmpty(feature) , feature['FACILITYID'] , null ) Arcade expressions are calculated on the fly, so the more concise your code the faster it will run. The challenge for the ultimate speed would be to take your 7 lines of code and have them on one line.
This example pulls over the address from a related table: When(!IsEmpty(First(FeatureSetByRelationshipName($feature, "Site ID",['Address']))), First(FeatureSetByRelationshipName($feature, "Site ID",['Address']))['Address'], null)
How would you be able to do this same thing but for an existing point layer in field maps that has attributes that I want to copy into a layer that I am creating on top of the existing point layer?
I found a solution that works if your two features are intersecting. var points = FeatureSetByName($map,"Test_Points") /* this gets the 'Test Points' layer from my collection map*/ var intersects = Intersects(Geometry($feature), points) /* this gets all the 'Test Points' that intersect my line attribute */ var cont = Count(intersects) /* this counts all the points that intersected my line */ if (cont>0){ */ I was trying to order the highest to largest slope with this loop, it may not be necessary for your purposes*/ for (var f in intersects) { var description = f.Calculated_Slope; /* this fills my description variable with the calculated slope from my other line*/ result = description else{ result = 0} return result Hope this helps!
Thank you for watching! If you have questions about our products or services, make sure to visit community.esri.com/. Is there a general topic you’d like us to cover in a future video? Let us know in the comments below!
Video was very helpful, thanks!
Why don't y'all ever want to use the When() function instead of the IF statement? It's so much more elegant, especially if you have more than one condition to check for.
return When(!IsEmpty(feature) , feature['FACILITYID'] , null )
Arcade expressions are calculated on the fly, so the more concise your code the faster it will run. The challenge for the ultimate speed would be to take your 7 lines of code and have them on one line.
This example pulls over the address from a related table:
When(!IsEmpty(First(FeatureSetByRelationshipName($feature, "Site ID",['Address']))), First(FeatureSetByRelationshipName($feature, "Site ID",['Address']))['Address'], null)
This is really useful, thank you.
Helped out a ton thanks for posting
How would you be able to do this same thing but for an existing point layer in field maps that has attributes that I want to copy into a layer that I am creating on top of the existing point layer?
I found a solution that works if your two features are intersecting.
var points = FeatureSetByName($map,"Test_Points") /* this gets the 'Test Points' layer from my collection map*/
var intersects = Intersects(Geometry($feature), points) /* this gets all the 'Test Points' that intersect my line attribute */
var cont = Count(intersects) /* this counts all the points that intersected my line */
if (cont>0){ */ I was trying to order the highest to largest slope with this loop, it may not be necessary for your purposes*/
for (var f in intersects) {
var description = f.Calculated_Slope; /* this fills my description variable with the calculated slope from my other line*/
result = description
else{ result = 0}
return result
Hope this helps!
a lot of thanks!
I've tried this for like an hour, but can't seem to get it to actually work.
same - did you ever get it work?
Does this work if going through ArcGIS Online to use Field Maps App or does this only work if you are using ArcGIS Enterprise?
Works for me with my ArcGIS Online license ... we don't have Enterprise.
Nice
Offline enabled?