I am creating an app in field maps for the first time for environmental monitoring. There is a monitoring site featureclass and then a related monitoring inspection table which field workers will be collecting monitoring sites and then repeated monitoring inspections at each site in the field. The featureclass and table are related using the GlobalIDs and GUID in ArcGIS Pro and then published to ArcGIS online and have started creating the forms for the fieldmaps app.
I have a SiteCode field set up in the monitoring site featureclass to give each monitoring site a more easily identifable ID for them to refer to. I don't know the workflow to make it easy for my field workers to populate the SiteCode field with an incremental number (or even better, say a 3 letter code for the site location and then an incremental number). So 10 monitoring sites in a park called Trafalgar would have codes such as TRA001, TRA002, TRA003 etc. Where there are 100 sites, it will be too tricky for field workers to work out the next in line so want to automate populating this somehow. I have seen mentions of attribute rules. Would this be the direction to go and would this work in Field Maps? Or can it be calculated with Arcade in fieldmaps? Or calculate from OBJECTID but probably less preferable. Having fieldmaps auto predict text could also probably help. My workers will be offline at times so ideally a solution that would work offline but else something that updates when it syncs could also do the trick.
Hi @karyn_rosa123 you can create IDs with the form calculations if they don't need to be sequential or unique.
If you need consistent sequence-based codes though, you should use Attribute rules. Attribute rules are evaluated on the server when the data is inserted/updates/deleted. Form calculations run on the device. Since the device may be offline, it will not have all the features available so it's possible it could generate a duplicate code.
Attribute rules are not supported in ArcGIS Online feature services, only certain implementations of ArcGIS Server/Enterprise feature services support them.
Hi @AaronPulver , thanks for your swift reply, greatly appreciated!
To create ID's with form calculations, (realising duplicate codes may be an issue when multiple people out in the field/offline), do you have any Arcade code I could copy as a starting point? Thanks heaps.
Not sure how you’ve progressed since the last post but this link was helpful for me