web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Sending Calendar Invit...
Power Apps
Answered

Sending Calendar Invites : fx ok in edit mode - after test, error message : "Status": 400,"message:"String not recognized as a valid DateTime

(0) ShareShare
ReportReport
Posted on by 12

Hi - This function actually a few weeks ago but now it is not.

 

The syntax is fine when it is in edit mode 1. However, after testing 2, an error message (below) is displayed. 

 

office365outlook.v4calendarpostitem failed: { "status": 400, "message": "string was not recognized as a valid datetime.\r\nclientrequestid: 96eac4b5-e4eb-4471-b059-ca9b67f9770d", "error": { "message": "string was not recognized as a valid datetime." },

 

Code: 

Office365Outlook.V4CalendarPostItem([@Calendar].Selected.name,"Test",DateAdd(Now(),TimeZoneOffset(),Minutes),DateAdd(Now(),30+TimeZoneOffset(),Minutes),"(UTC) Coordinated Universal Time")

Mango99_uk_0-1661912859503.png

 

Syntax for Calendar dropdown seems to be ok.

Code: 

Office365Outlook.CalendarGetTablesV2().value.name

Mango99_uk_1-1661912932750.png

 

Would appreciate if someone can help !

 

Thanks

Categories:
  • Verified answer
    BlessedCobba Profile Picture
    459 Super User 2024 Season 1 on at

    @Mango99_uk 

    Here is my working code for a Calendar invite 

     

    Office365Outlook.V4CalendarPostItem( 
     LookUp(Office365Outlook.CalendarGetTables().value, DisplayName = "Calendar").Name,
     selectedDesk.Description,
     Text(If(TimeZoneOffset(Now())/60 = vUTCHomeHrs, startTime, DateAdd(startTime,vUTCHomeHrs-TimeZoneOffset(Now())/60,Hours)),DateTimeFormat.UTC),
     Text(If(TimeZoneOffset(Now())/60 = vUTCHomeHrs, endTime, DateAdd(endTime,vUTCHomeHrs-TimeZoneOffset(Now())/60,Hours)),DateTimeFormat.UTC),
     "UTC",
     {body: htmlCalendarInviteBody.HtmlText }


    Try updating the times to 

    Text(DateAdd(Now(),TimeZoneOffset(),Minutes),UTC)



  • Mango99_uk Profile Picture
    12 on at

    Thank you ! @BlessedCobba. This worked !

    Office365Outlook.V4CalendarPostItem( 
     ddCalendar.SelectedText.name, 
     "Meeting!!!",
     Text(DateAdd(Now(),TimeZoneOffset(),Minutes),UTC),
     Text(DateAdd(Now(),30+TimeZoneOffset(),Minutes),UTC),
     "UTC",
     {body: "Meeting Notes"}
    )

     

    Would you know how I can add the time slots based on the combo/drop down lists?

    StartDate1.SelectedDate & " " & " " & StartHour1.Selected.Value & "" & ":" & StartMin1.Selected.Value

     This displays the date and time in a label box - seems to be errors.

     

    Mango99_uk_0-1661926359150.png

    Thanks !

  • BlessedCobba Profile Picture
    459 Super User 2024 Season 1 on at

    @Mango99_uk 

    Is it erroring because of the double (( after DateAdd? 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 350 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard