How to insert null value to datetime column using rest api

Mohammad Qasim 576 Reputation points
2020-12-23T07:57:15.57+00:00

Hi,

Solution required:
How can I send null or empty value to datetime column of custom list using rest api.

Note: if I pass proper date value so rest api works to update item but as I send null value its not updating relevant records.

Error image is attached:50713-datetimeemptyerror.png

Thanks

Microsoft 365 and Office SharePoint Server Development
{count} votes

Accepted answer
  1. MichaelHan-MSFT 18,126 Reputation points
    2020-12-24T07:31:54.937+00:00

    Hi, @Mohammad Qasim ,

    You could insert null value to datetime column using rest api like the below:

    {  
      "__metadata": {  
        "type": "SP.Data.ListNameListItem"  
      },  
      "Title": "test",  
      "DateColumn": null  
    }  
    

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.