How can i set a date field to null?
I've got a date picker in a display form, our users would like the ability to be able to clear a populated date from the field. What do I need to put in the attribute value field of the Set Feature Attribute activity so the REST service doesn't reject the update feature call?
-
What error do you get?
If I understand right, you're wanting to update just the one feature, not the entire feature set, is that right? (If you were wanting to remove it from the entire Feature Set, there is an activity called Remove Feature Set Fields, which could do this.)
However, to update a single feature I think you'd need to set the value to undefined.
0 -
Thanks for the reply Ken, it turns out i was missing the '=' in front of the NULL when i was trying to set the new value of the feature before passing it onto the REST service.
0 -
I am trying to set my date field to NULL, but have been unsuccessful - any insight would be appreciated. This is what i am doing now that isn't working. It just leaves the current value in the date field as is - doesn't reset it to NULL.
0 -
Darryl Klassen try removing the = and " from the attribute name so it us just LASTSERVICEDATE
0 -
Hi Bryan, thanks for the suggestion. Changing the “Attribute Name” doesn't seem to make a difference. I can set the “Attribute Value” to be ='Jan 1, 2025' and that works fine, but just cannot set it back to NULL for some reason. I can set it to NULL manually in the attribute table, but not in the workflow.
This works, but cannot set it to Null:
0 -
Darryl Klassen In TypeScript and JavaScript, null is lower-case.
Try setting Attribute Value to
=null.1 -
Try =null in the attribute value. the below image works in our environment

It might be because you're using a set feature attribute activity to edit a for/each loop property. have you tried the set property activity? I usually only use the set feature attribute activity when changing the value in the object we queried from my feature service that's going to get sent back through to the geodatabase using the update features activity.
1 -
Yes, that did it. Thanks Ken and Bryan for your help.
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
8 kommentarer