Skip to main content

How can i set a date field to null?

Comments

8 comments

  • Ken Lyon

    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
  • Bryan Bingham

    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
  • Darryl Klassen

    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
  • Bryan Bingham

    Darryl Klassen try removing the = and " from the attribute name so it us just LASTSERVICEDATE

    0
  • Darryl Klassen

    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
  • Ken Lyon

    Darryl Klassen In TypeScript and JavaScript, null is lower-case.

    Try setting Attribute Value to =null.

    1
  • Bryan Bingham

    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
  • Darryl Klassen

    Yes, that did it.  Thanks Ken and Bryan for your help.
     

     

    0

Please sign in to leave a comment.