Common Issues when Creating Outlook Calendar Invite through PowerApps

We have a lot of requirements to create an outlook calendar invite through PowerApps. We will discuss the common issues that users are encountering like timezone, Combobox not displays the name, Time off by x hours, or not creating invites/events when adding required attendees.

 

Setup to Add Invite

 

 

Required and Optional Attendees Items Property (Office 365 users)

 

Office365Users.SearchUser({searchTerm: “”})

 

We can also use SP Person Column

Choices([@SPList].PersonColumnName)

Set the Primary text and Searchfield for that Combobox

  • Select the Combobox
  • Click “Edit” on the right-side properties
  • Set Primary text (DisplayFields) and Searchfield as “DisplayName”

Which is

Difference between Office365 and SP column

Concat(RequiredAttendess.SelectedItems.Mail,Mail& “;”), //Office 365 Users

vs

Concat(RequiredAttendess.SelectedItems.Email ,Email & “;”), //SP Person Column

Syntax to create an invite/event

Office365Outlook.V4CalendarPostItem(
table,
subject,
start,
end,
timeZone,
{
requiredAttendees:Text,
optionalAttendees:Text,
resourceAttendees:Text,
body:Text,
location:Text,
importance:Text,
isAllDay:Boolean,
recurrence:Text,
recurrenceEnd:Text,
numberOfOccurences:Number,
reminderMinutesBeforeStart:Number,
isReminderOn:Boolean,
showAs:Text,
responseRequested:Boolean,
sensitivity:Text
}
)

OnSelect Property of ‘Send Calendar Invite”

Will split into multiple sections for easy understanding.

1. Table – Name of the Calendar from your outlook

LookUp(
Office365Outlook.CalendarGetTables().value,
DisplayName = “Calendar”
).Name

2. Subject

SubjectInput.Text

3. Start

Text(
DateAdd(
DateTimeValue(
StartDatePicker.SelectedDate & ” ” & TimeValue(
Concatenate(
StartHour.Selected.Value,
“:”,
StartMinute.Selected.Value
)
)
),
TimeZoneOffset(),
Minutes
),
“yyyy-mm-ddTHH:mm:ssZ”
),

4. End

Text(
DateAdd(
DateTimeValue(
EndDatePicker.SelectedDate & ” ” & TimeValue(
Concatenate(
EndHour.Selected.Value,
“:”,
EndMinute.Selected.Value
)
)
),
TimeZoneOffset(),
Minutes
),
“yyyy-mm-ddTHH:mm:ssZ”
),

5. Timezone

“(UTC) Coordinated Universal Time”

6. Body

body: ‘Email Content’.HtmlText

6. RequiredAttendees

requiredAttendees: Concat(
RequiredAttendess.SelectedItems.Mail,
Mail & “;”
),

7. OptionalAttendees

optionalAttendees: Concat(
OptionalAttendess.SelectedItems.Mail,
Mail & “;”
),

8. Other Few Properties

isReminderOn: Reminder.Value,
reminderMinutesBeforeStart: 30,
responseRequested: ResponseRequested.Value

Complete “Create Calendar Invite” code

Office365Outlook.V4CalendarPostItem(
LookUp(
Office365Outlook.CalendarGetTables().value,
DisplayName = “Calendar”
).Name,
SubjectInput.Text,
Text(
DateAdd(
DateTimeValue(
StartDatePicker.SelectedDate & ” ” & TimeValue(
Concatenate(
StartHour.Selected.Value,
“:”,
StartMinute.Selected.Value
)
)
),
TimeZoneOffset(),
Minutes
),
“yyyy-mm-ddTHH:mm:ssZ”
),
Text(
DateAdd(
DateTimeValue(
EndDatePicker.SelectedDate & ” ” & TimeValue(
Concatenate(
EndHour.Selected.Value,
“:”,
EndMinute.Selected.Value
)
)
),
TimeZoneOffset(),
Minutes
),
“yyyy-mm-ddTHH:mm:ssZ”
),
“(UTC) Coordinated Universal Time”,
{
body: ‘Email Content’.HtmlText,
requiredAttendees: Concat(
RequiredAttendess.SelectedItems.Mail,
Mail & “;”
),
optionalAttendees: Concat(
OptionalAttendess.SelectedItems.Mail,
Mail & “;”
),
isReminderOn: Reminder.Value,
reminderMinutesBeforeStart: 30,
responseRequested: ResponseRequested.Value
}
)

Output

Demo

Common Issues and Solutions

  1. Sending invite as UTC time
    1. “(UTC) Coordinated Universal Time”
  2. Convert time using TimeValue( to get the right format
    1. TimeValue(Concatenate(EndHour.Selected.Value,”:”,EndMinute.Selected.Value
      ))
  3. Use TimeZoneOffset
    1. DateTimeValue(EndDatePicker.SelectedDate & ” ” & TimeValue(
      Concatenate(EndHour.Selected.Value,”:”,
      EndMinute.Selected.Value))),TimeZoneOffset(),Minutes),
  4. Required Attendees are users so need to send email id with comma separators like
    1. Concat(RequiredAttendess.SelectedItems.Mail,Mail & “;”),
  5. You may get property like builtinicon:Mail, this means not accessing right property
    1. For Example, Concat(RequiredAttendess.SelectedItems.Email,Mail&”;”). It should be
    2. Concat(RequiredAttendess.SelectedItems.Email,Email&”;”)
  6. Set DisplayFields and SearchFields for the Combobox
    1. [“DisplayName”]

18 comments

  1. Hi There,
    Has anyone experienced an issue with this? I have incorporated this as part of my PowerApp but now it seems to be loading multiple calendar invites into the owner’s calendar as a calendar entry is added to a user’s calendar. I have tried to remove this code in totally but it still seems to be doing the same.
    Kindly advise.
    Many thanks,
    Melanie

  2. Hi Melanie,

    Would you please validate a few things

    1. Do you have any other “power automate” to create a calendar invite?
    2. Do you have a ForAll loop or something?
    3. Is it vary (No of entries) whenever you click it?

    Thanks
    Stalin

    1. For a time, it’s just a dropdown control. Items property of Hour will be [“00″,”01″,”02″,”03″,”04″,”05″,”06″,”07″,”08″,”09″,”10″,”11″,”12″,”13″,”14″,”15″,”16″,”17″,”18″,”19″,”20″,”21″,”22″,”23”] and

      Items property of Minutes will be [“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”]

  3. Hi sir, I´m very appreciated for your contribution, is really nice. I have an issue when I send the Calendar Invite. The message error is: String was not recognized as a valid DateTime, status 400. Could you tell me how to fix this error?. My code is exactly as yours. Thanks in advance

    1. Hi Mike,

      Not sure what changed in the last eight months. It’s expected in UTC format now. I updated the post to reflect it.

      Solution: We have to convert to UTC format like
      Text(
      DateAdd(
      DateTimeValue(
      StartDatePicker.SelectedDate & ” ” & TimeValue(
      Concatenate(
      StartHour.Selected.Value,
      “:”,
      StartMinute.Selected.Value
      )
      )
      ),
      TimeZoneOffset(),
      Minutes
      ),
      “yyyy-mm-ddTHH:mm:ssZ”
      ),

  4. Thanks for posting! Is this the only way to get around the connector issue of someone other than the owner being logged into the PowerApp? I have an app connected to the Create Event (v4) and the flow fails when anyone but me runs it.

  5. How do to set it for all day? When I use the optional parameter, it says the duration of an event marked as all day must be 24 hrs. I didn’t provide a time just a date.

  6. I’ve been to so many resource trying to resolve this and it worked perfectly with a couple of minor adaptations to my own app! Thanks so much ! You saved MY day and I can now move forward after tearing my hair out for too long!

  7. What about end-users who use different date formats (as opposed to different time zones)? I have a user who cannot get this to consume the date and time date properly for users who use a different date format.

Leave a Reply

Your email address will not be published. Required fields are marked *