Select to view content in your preferred language

Calculate Field won't update a date field

577
4
04-02-2024 06:53 AM
Labels (3)
JayHodny
Frequent Contributor

Hello.  I am trying to update a date field to Null in a Server service published from Pro.  The date data come from a Survey123 Connect form field, passed to the corresponding Server feature service fields via a python script.  I am testing a workflow and need to return the service fields for my point features to Null.  Calculate Field works as expected for the other fields (non-date).  I can manually update the date field value to Null be deleting the value in each record.  I can't figure out why I can do this manually, yet the Calculate Field tool will not do the same.  I have tried SQL, Arcade and Python code options in the tool, same 99999 error for each.  What simple thing am I missing?

JayHodny_0-1712065959220.png

 

4 Replies
Robert_LeClair
Esri Notable Contributor

So for the selected row in question, right click tghe request_completed_date field and click the Calculate Field command.  This opens the Calculate Field GP tool.  Make sure the Expression Type is Python.  Select the date/time field, if necessary, and for the calculation type the None.  This will set the selected field to a Null value.  See my screen grab below.

calculateFieldNull.JPG

0 Kudos
JayHodny
Frequent Contributor

Hi Robert,

Thanks for the reply.  I did exactly the workflow you described prior to my post, with no success.  I tried python, sql, arcade, same result.  Mystery...Regards, Jay

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

Have you tried using an UpdateCursor—ArcGIS Pro | Documentation?  If so, any error messages?

0 Kudos
JayHodny
Frequent Contributor

Hi Joshua, I have not tried Update Cursor.  I am a Python novice, but I may give it a try.  Thank you for your help. Regards, Jay

0 Kudos