Skip to main content
Community site session details

Community site session details

Session Id : ClwMFZPPKZGA4kjuX5ihsf
Power Automate - Using Connectors
Answered

Problem with data format when trying to upadate item on Sharepoint list

Like (1) ShareShare
ReportReport
Posted on 18 May 2020 08:13:23 by 22

Hello, 
I am trying send an http request to Sharepoint calendar to update event by using flow like this:

image.pngimage.png


This is a body:

 

{
"formValues": 
[

{"FieldName": "EventDate", "FieldValue": "5/10/2020 0:00 AM"},
{"FieldName": "EndDate", "FieldValue": "5/10/2020 0:00 AM"},
{"FieldName": "fAllDayEvent", "FieldValue": "True"}
],
"bNewDocumentUpdate": true
}

 

This is a response:

 

{
 "d": {
 "ValidateUpdateListItem": {
 "__metadata": {
 "type": "Collection(SP.ListItemFormUpdateValue)"
 },
 "results": [
 {
 "ErrorMessage": "Enter a date and time like this: 2/23/2012 2:25 PM",
 "FieldName": "EventDate",
 "FieldValue": "5/10/2020 0:00 AM",
 "HasException": true,
 "ItemId": 34
 },
 {
 "ErrorMessage": "Enter a date and time like this: 2/23/2012 2:25 PM",
 "FieldName": "EndDate",
 "FieldValue": "5/10/2020 0:00 AM",
 "HasException": true,
 "ItemId": 34
 },
 {
 "ErrorMessage": null,
 "FieldName": "fAllDayEvent",
 "FieldValue": "True",
 "HasException": false,
 "ItemId": 34
 }
 ]
 }
 }
}

 

 

I was formatted datetime by using the formula:

formatDateTime( if(empty(triggerBody()?['XXX']),triggerBody()?['YYY'],triggerBody()?['ZZZ']),'M/d/yyyy H:mm tt')
Also I was trying insert there for example: 'M/d/yyyy H:m tt', 'MM/dd/yyyy HH:mm tt', but nothing is work, always the same exception. Does somebody have any ideas what can also I try ? 

  • Verified answer
    Alicja Profile Picture
    22 on 28 May 2020 at 12:09:57
    Re: Problem with data format when trying to upadate item on Sharepoint list

    I am using now formulas like below and it works for me:

    {
    "formValues": 
    [
    
    {"FieldName": "EventDate", "FieldValue": "@{formatDateTime(variables('StartDate'), 'yyyy-MM-dd 12:00:00')}"},
    {"FieldName": "EndDate", "FieldValue": "@{formatDateTime(variables('EndDate'), 'yyyy-MM-dd 23:59:00')}"},
    {"FieldName": "fAllDayEvent", "FieldValue": "True"}
    ],
    "bNewDocumentUpdate": true
    }

     

    Thank you for your help 😉

  • Verified answer
    v-bacao-msft Profile Picture
    on 21 May 2020 at 05:00:14
    Re: Problem with data format when trying to upadate item on Sharepoint list

     

    Hi @Alicja ,

     

    If you want to create/update the event as an all-day event, EndDate needs to be yyyy-MM-ddT23:59:00.

    Please check the following links:

    https://powerusers.microsoft.com/t5/I-Found-A-Bug/All-Day-Event-in-a-SharePoint-Calendar-is-not-recognized-as-a/td-p/278310

    https://github.com/SharePoint/sp-dev-docs/issues/2755

     

     

    Best Regards,

  • Alicja Profile Picture
    22 on 19 May 2020 at 10:20:09
    Re: Problem with data format when trying to upadate item on Sharepoint list

    It is not working for me. 

    Input body:

    {
    "formValues": 
    [
    
    {"FieldName": "EventDate", "FieldValue": "2020-05-20T00:00:00Z"},
    {"FieldName": "EndDate", "FieldValue": "2020-05-20T00:00:00Z"},
    {"FieldName": "fAllDayEvent", "FieldValue": "True"}
    ],
    "bNewDocumentUpdate": true
    }

    Output body:

     

    {
     "d": {
     "ValidateUpdateListItem": {
     "__metadata": {
     "type": "Collection(SP.ListItemFormUpdateValue)"
     },
     "results": [
     {
     "ErrorMessage": "You must specify a valid date within the range of 1/1/1900 and 12/31/8900.",
     "FieldName": "EventDate",
     "FieldValue": "2020-05-20T00:00:00Z",
     "HasException": true,
     "ItemId": 43
     },
     {
     "ErrorMessage": "You must specify a valid date within the range of 1/1/1900 and 12/31/8900.",
     "FieldName": "EndDate",
     "FieldValue": "2020-05-20T00:00:00Z",
     "HasException": true,
     "ItemId": 43
     },
     {
     "ErrorMessage": null,
     "FieldName": "fAllDayEvent",
     "FieldValue": "True",
     "HasException": false,
     "ItemId": 43
     }
     ]
     }
     }
    }

     

  • v-bacao-msft Profile Picture
    on 19 May 2020 at 02:47:46
    Re: Problem with data format when trying to upadate item on Sharepoint list

     

    Hi @Alicja ,

     

    Please try this format: yyyy-MM-ddTHH:mm:ssZ 

     

    Best Regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Featured topics

Loading complete