Field calculator not working in ArcGIS Pro (2.2) with a joined table

3968
6
04-03-2019 05:22 PM
HeatherTaylor4
New Contributor

I  created a task in ArcGIS Pro 2.1 that updates a field in a feature service in ArcGIS online with the local government area that the point is in. The task performed a spatial join between the feature service (points where disaster impacts had occurred) and the LGA data set, joined the new feature class table back to the original service and then did a 'calculate field'  to update the local government area details in the original service.

This worked fine in 2.1 but when I changed to 2.2.4 the task failed. I have also tried running it manually with the separate tools and it fails on the calculate field step. The error message varies: I have had 'error 002536 - does not support or is not in a state to support SQL expressions' and error 999999 'the fields collection contained multiple OID fields'. 

Any suggestions?

0 Kudos
6 Replies
DanPatterson_Retired
MVP Emeritus

https://community.esri.com/message/841522-re-arcgis-pro-calculate-field-using-sql-not-honoring-selec... 

related thread but mentioning your error message therein.  initially relating to duplicate layer names (not field names), but references to the data type and sql not working (try a python expression instead)

HeatherTaylor4
New Contributor

Thanks Dan. The task I had set up was using a python expression (that was giving the error about multiple OIDs) and I just realised that when I ran the 'calculate field' tool manually it was defaulting to SQL. It is still failing with a python expression but giving the error 'ERROR 999999: Something unexpected caused the tool to fail.
The Fields collection contained multiple OID fields' instead of the error 002536. 

0 Kudos
DanPatterson_Retired
MVP Emeritus

Since it is in a task, do you have a screen grab of trying it manually or the expression? The 999999 error is pretty well anything from formatting onward

0 Kudos
HeatherTaylor4
New Contributor

The expression is very simple as I am literally just copying from one field in the joined table to a field in the feature service. It works fine in Pro 2.1 but not 2.2. 

0 Kudos
DanPatterson_Retired
MVP Emeritus

Heather, I can't test, but if you want to see if it was and issue that was found and addressed, then

Release notes for ArcGIS Pro 2.3—ArcGIS Pro | ArcGIS Desktop 

If you upgraded and it still persists, or wasn't on the 'fixed' list, then you will have to Tech Support it

0 Kudos
MichaelVolz
Esteemed Contributor

Wouldn't it be a nice feature if Attribute Rules in Pro could perform this process like Attribute Assistant can in ArcMap without the need for a spatial join?