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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Creating an event with...
Power Apps
Answered

Creating an event with the Outlook connector

(0) ShareShare
ReportReport
Posted on by

Hi All,

 

I have to design a canvas app for creating an event in Outlook. 

So on the OnSelect property of a button I have this formula:

Office365.V2CalendarPostItem(
 MyCalendarID,
 Subject.Text,
 StartDate.SelectedDate,
 EndDate.SelectedDate,
 {
 TimeZone: "W. Europe Standard Time",
 RequiredAttendees: "email",
 OptionalAttendees: "email",
 ResourceAttendees: "",
 Body: "test",
 IsHtml: true,
 Location: "teams",
 Importance: "High",
 IsAllDay: false,
 Recurrence: ""
 }
)

Which works ok. However, I do need start time and end time, so I do this:

Office365.V2CalendarPostItem(
 MyCalendarID,
 Subject.Text,
 StartDate.SelectedDate + Time(Value(StartTimeHH.Selected.Value),Value(StartTimeMM.Selected.Value),0),
 EndDate.SelectedDate + Time(Value(EndTimeHH.Selected.Value),Value(EndTimeMM.Selected.Value),0),
 {
 /*TimeZone: "W. Europe Standard Time",*/
 RequiredAttendees: "",
 OptionalAttendees: "",
 ResourceAttendees: "",
 Body: "test",
 IsHtml: true,
 Location: "teams",
 Importance: "High",
 IsAllDay: false,
 Recurrence: ""
 }
)

and it returns an error "At least one propery failed validation". I have watched the resources online and can't seem to find the issue. Obviously, for some reason, the data/time object is nor formatted properly. 

I know I could do this with a flow, but I would appreaciate any ides to make it work via the form itself. 

Thank you. 

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hey @Anonymous 

     

    I am not able to reproduce this issue shared by you. Can you please share more details about the configuration in your app?
     
    What do you have in the Items property of Hours and Minute dropdown, can you try to update them with below expressions:
     
    Hours:
    ["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"]
    Minutes:
    ["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"]
     
    Hope this Helps!
     
    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @Anonymous ,

    Could you please share more details about the error message within your formula?

    Could you please share a screenshot about it?

     

    I have made a test on my side, please consider take a try with the following workaround:11.JPG

    Set the OnSelect property of the "Post Event" button to following:

    Office365Outlook.V2CalendarPostItem(Dropdown1.Selected.Name, "Portal Event", "2019-10-03T14:30:00Z", "2019-10-04T10:30:00Z")

    On your side, please consider modify your formula as below:

    Office365Outlook.V2CalendarPostItem( /* <-- Please note: the Office365 prefix has been changed into Office365Outlook */
     MyCalendarID,
     Subject.Text,
     Text(StartDate.SelectedDate + Time(Value(StartTimeHH.Selected.Value),Value(StartTimeMM.Selected.Value),0), "yyyy-mm-ddTHH:mm:ssZ"), /* <-- Modify formula here */
     Text(EndDate.SelectedDate + Time(Value(EndTimeHH.Selected.Value),Value(EndTimeMM.Selected.Value),0), "yyyy-mm-ddTHH:mm:ssZ"), /* <-- Modify formula here */
     {
     /*TimeZone: "W. Europe Standard Time",*/
     RequiredAttendees: "hristo.hristov@atlascopco.com",
     OptionalAttendees: "hristo.hristov@atlascopco.com",
     ResourceAttendees: "",
     Body: "test",
     IsHtml: true,
     Location: "teams",
     Importance: "High",
     IsAllDay: false,
     Recurrence: ""
     }
    )

    or

    Office365Outlook.V2CalendarPostItem( /* <-- Please note: the Office365 prefix has been changed into Office365Outlook */
     MyCalendarID,
     Subject.Text,
     Text(StartDate.SelectedDate + Time(Value(StartTimeHH.Selected.Value),Value(StartTimeMM.Selected.Value),0), DateTimeFormat.UTC), /* <-- Modify formula here */
     Text(EndDate.SelectedDate + Time(Value(EndTimeHH.Selected.Value),Value(EndTimeMM.Selected.Value),0), DateTimeFormat.UTC), /* <-- Modify formula here */
     {
     /*TimeZone: "W. Europe Standard Time",*/
     RequiredAttendees: "hristo.hristov@atlascopco.com",
     OptionalAttendees: "hristo.hristov@atlascopco.com",
     ResourceAttendees: "",
     Body: "test",
     IsHtml: true,
     Location: "teams",
     Importance: "High",
     IsAllDay: false,
     Recurrence: ""
     }
    )

     

    Please take a try with above solution, then check if the issue is solved.

     

    Best regards,

  • Community Power Platform Member Profile Picture
    on at

    @v-xida-msft , thank you very much. I got the connector working. 

    When the start time & end time values are hardcoded it works fine. 

     

    I tried both

    Text(StartDate.SelectedDate + Time(Value(StartTimeHH.Selected.Value),Value(StartTimeMM.Selected.Value),0), DateTimeFormat.UTC), 
    Text(EndDate.SelectedDate + Time(Value(EndTimeHH.Selected.Value),Value(EndTimeMM.Selected.Value),0), DateTimeFormat.UTC),

    and 

     Text(StartDate.SelectedDate + Time(Value(StartTimeHH.Selected.Value),Value(StartTimeMM.Selected.Value),0), "[$-en-US]yyyy-mm-ddTHH:mm:ssZ"), 
     Text(EndDate.SelectedDate + Time(Value(EndTimeHH.Selected.Value),Value(EndTimeMM.Selected.Value),0), "[$-en-US]yyyy-mm-ddTHH:mm:ssZ"), 

    They both return the same error "at least one property failed validaiton".

    So obviously something is still wrong with the format, which is quite to my surprise. 

     

    I tried [$-fr-FR] as well, wheras [$-en-US] gets prepended automatically. Any further ideas please?

  • Community Power Platform Member Profile Picture
    on at

    Nevermind, the (stupid) issue was that I was using my hours input for the minutes and minutes input for hours, so that is why the valiation error. 

    This also works and that's how I found out my mistake:

    "2019-" & Month(StartDate.SelectedDate) & "-" & Day(StartDate.SelectedDate) & "T" & StartTimeHH.Selected.Value & ":" & StartTimeMM.Selected.Value & ":00Z",
    "2019-" & Month(EndDate.SelectedDate) & "-" & Day(EndDate.SelectedDate) & "T" & EndTimeMM.Selected.Value & ":" & EndTimeHH.Selected.Value & ":00Z",

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard