This is a quesiton in lieu of Attribute Rules. I have arborists collecting data about Trees. They give each tree a unique reference (T1, T2 and so on). I would like this field in their form to automatically complete based on the object ID as the default value. But I would also like them to be able to edit this value if they wish.
Is there a way of using an expression to set a default value thats "T"+!ObjectID! or something along these lines?
The alternative would be just to remove this field and just use the object ID, and generate a Tn reference after Field Mapping.
Solved! Go to Solution.
You could create an arcade expression to fetch the latest OBJECTID using Arcade, add 1 and go from there:
var itemid = // your portal item id
var portalurl = // your portal url or "https://arcgis.com"
var fs = FeatureSetByPortalItem(Portal(portalurl),itemid)
return Max(fs, "OBJECTID") +1
This might not be the best way to go though if you have multiple users collecting data simultaneously or have users that work offline. An attribute rule will probably be a better idea indeed.
You could create an arcade expression to fetch the latest OBJECTID using Arcade, add 1 and go from there:
var itemid = // your portal item id
var portalurl = // your portal url or "https://arcgis.com"
var fs = FeatureSetByPortalItem(Portal(portalurl),itemid)
return Max(fs, "OBJECTID") +1
This might not be the best way to go though if you have multiple users collecting data simultaneously or have users that work offline. An attribute rule will probably be a better idea indeed.
@HuubZwart that's a nice idea, but they're exclusively offline, so Im guessing this wouldn't work. As it has been for the last 2 years; I will await Attribute Rules on AGOL!
Hi,
I would also like to have a sequential ID offline, but it can be related to the Field Maps user and not the entire dataset.
Did you figure out a work around for this?
Thanks!,
Kathy