Attribute Rule to populate field with OBJECTID

287
9
03-15-2024 08:44 AM
Labels (1)
MaryDuBose
New Contributor III

I need some help setting up an attribute rule. I thought it would be a very straightforward one, but it's not behaving as expected. It is a Calculation rule that is supposed to populate an additional field with the value of the record's ObjectID. The expression I currently have in there is:

$feature.OBJECTID

And the "Insert" trigger checkbox is the only one checked. 

Instead of populating each feature with its own ObjectID, what is actually happening is that when someone saves their edits, the entire batch of features that have been added since the last save get populated with the same ObjectID of the first feature in the batch. For example, someone adds 3 features since their last save. ObjectID 10, 11, and 12. The additional ID field that I'm trying to populate instead gets the values 10, 10, and 10. 

The data is in an ArcSDE geodatabase, and we are using ArcPro 3.2.1. 

Do I need to check the box for "Exclude from application evaluation"? Or edit the expression in some way? Or is this workflow just not possible?

0 Kudos
9 Replies
ZachBodenner
MVP Regular Contributor

I'm not 100% sure if it'll solve the issue, but I pretty much check that box as a matter of course. What you're describing certainly doesn't sound like it should be happening. Also, possibly uncheck the box for "editable"? That might help prevent adjustments after the rule runs?

 

0 Kudos
MaryDuBose
New Contributor III

Zach, thanks for the reply! It's taken me a while to follow up on this but unfortunately that did not prevent the issue from happening. Should I maybe report this as a bug to Esri? The issue seems to happen when multiple records are saved at the same time with the same attributes. They have unique ObjectIDs as expected, but the value of this additional field will be the same for all. 

0 Kudos
ZachBodenner
MVP Regular Contributor

Hey Mary, so clarify, the workflow is that you have this rule set up, then a user goes in to edit the dataset (in Pro? on the web?) and makes multiple additions to the dataset (let's say objectID's 100, 101, and 102). Then the result is that the values in "New Column" all read 100?

0 Kudos
MaryDuBose
New Contributor III

Yes, exactly. They are editing in ArcPro 3.2.1 and there are multiple users editing simultaneously using ArcSDE with a Microsoft SQL Server database.

0 Kudos
ZachBodenner
MVP Regular Contributor

Ok thanks, I'm going to run a test myself and see if I get the same thing!

0 Kudos
ZachBodenner
MVP Regular Contributor

Does your attribute rule look something like this?:

 

ZachBodenner_0-1711560608728.png

If I have mine setup like this, the OID gets calculated correctly whenever I click to add a new point, regardless of when the edits get saved. Maybe your configuration is different?

0 Kudos
MaryDuBose
New Contributor III

Yes, mine looks identical to that. Thank you for testing! This is a strange issue, glad to know I haven't set it up wrong but this is quite the mystery.

0 Kudos
ZachBodenner
MVP Regular Contributor

When you say "simultaneous editing," are you talking just a few people using the data at once, or is there versioning involved? I don't know much about versioning so you might look into that, otherwise bring it up with Esri is probably a good idea.

0 Kudos
MaryDuBose
New Contributor III

This is versioned data using traditional versioning where versions are reconciled nightly. I have a support case started with Esri so hopefully will get some answers on this soon!

0 Kudos