TL/DR: Is there a way to auto-increment fields in Field Maps? I'm looking to configure a field with sequential integers for each new point feature (1, 2, 3, 4...)
I work in soils and use Field Maps to collect point features with form data (photo of form attached) in different numbered unit areas. We need to know how many points we have done in each unit, and counting or manually entering the point feature count/number is tedious out in the field.
Is there a way to auto-increment and display the number point in that unit? For example, if this is the sixth point that a worker has taken in unit 45 is there a way for to autofill "6" in that form? I saw some posts from 2016 that said Esri was "working on" this functionality.
Thank you!
Solved! Go to Solution.
Hey, I've been able to do something similar to your idea using immediate calculation attribute rules and NextSequenceValue. Having it increment and reset for specific areas is probably outside of the scope of what it can do unless you make a sequence per unit #.
Hey, I've been able to do something similar to your idea using immediate calculation attribute rules and NextSequenceValue. Having it increment and reset for specific areas is probably outside of the scope of what it can do unless you make a sequence per unit #.
@CraigMueller1 I'm a complete newbie to Arcade, I could do with some help on where the "NextSequenceValue('PipeIDSeq')" goes into a form and is this the only code that's needed? I do realise the PipeID will have to reference the correct field.
Many thanks and so sorry for such a basic question.
Hey Jonathan, sorry for not responding earlier. At the moment running Arcade expressions like NextSequenceValue can't be done in the form, but instead are run at the geodatabase level using calculation attribute rules. Here is an overview page I found on them. In Pro you can set up an attribute rule on a specific field to do a calculation when a specific event occurs. I use immediate calculation rules in a few places to have a field update or populate, and for NextSequenceValue specifically I use it to increment an integer field on insert of a new record. I mention "at the moment" because several blog posts about what's coming in Field Maps have insinuated (at least in my mind) that we may be able to have some attribute rule or similar automated calculations fire at the form level instead of the geodatabase level though I'd imagine in this case it would still only be possible to do at the geodatabase since the sequence itself is set up as a database object using the Create Database Sequence geoprocessing tool. I'm sure all of this explanation is a confusing mess, but I hope the overview steers you in the right direction.
I ended up at this page as I wanted to achieve the same thing, an incrementing field in FieldMaps. I had followed the instructions here and I'm using ArcPro 2.8.1. It works fine in ArcPro but does not migrate to FieldMaps when you upload the layers to AGOL. I stumbled around a bit more on the internet and found this recent webinar on Youtube. Jump to about 34:20 and they explain that Attribute Rules are something they are working on. So as of now August 2021 it does not seem to be functionality in FieldMaps but something I hope is released in their next update.
Hi @DuncanHornby just checking were you able to set up Attribute Rules in Field Maps yet? I wasn't able to, so was just wondering if the functionality isn't available yet.
I've not needed to do such work so have not followed up any development in field maps. So based upon your experience I guess not.
I am trying to create an app for roadway signs collection and have the NextSequenceValue setup on Pro. I got the database sequence setup as well based off some resources online. It works really well on Pro whenever I'd test it to create a new point, the assetID is being created with my desired values and is incrementing properly as well. But when I share it to my org's AGOL and configured it with Field Maps Designer, the assetID just stays at null but the point is successfully created.
What database are you using? If its SQL server there's a specific permission required on the database to use sequences.
Did you publish the service with attribute rules enabled?
I had a similar issue and come up with a solution, though it is not perfect because having multiple editors collecting data in the same land segment while offline would throw off the count. For my survey, I am auto-incrementing the number of trees collected within different project location boundaries.
Solution:
**For me: Field_1 = Project_Location and Field_2 = Tree_Number