To build on this, specifically using the FeatureSetByPortalItem function allows you to bring in any other web layer you have access to, even those not in your Portal. No joins required, and this function should work in Pro as well.
Consider this example: I've got a test layer, and I want to update one of its fields. I have have chosen the Living Atlas's OpenStreetMap Shops, and will pipe in one of its attribute.
// get osm shops
var fs = FeatureSetByPortalItem(
Portal('https://kendall.maps.arcgis.com/'),
'a917a3c9e89544d9a1446251bb693bbd',
0
)
// get first feature
var feat = First(fs)
// return `shop` attribute
return feat['shop']
And that's it! Note that I just grabbed the first feature for each, since I don't actually have a shared field between these layers, but you could easily use Filter on the featureset to get matching records based on some ID, or even use a spatial intersection to find features which intersect with yours.
- Josh Carlson
Kendall County GIS