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”
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
- Sending invite as UTC time
- “(UTC) Coordinated Universal Time”
- Convert time using TimeValue( to get the right format
- TimeValue(Concatenate(EndHour.Selected.Value,”:”,EndMinute.Selected.Value
))
- TimeValue(Concatenate(EndHour.Selected.Value,”:”,EndMinute.Selected.Value
- Use TimeZoneOffset
- DateTimeValue(EndDatePicker.SelectedDate & ” ” & TimeValue(
Concatenate(EndHour.Selected.Value,”:”,
EndMinute.Selected.Value))),TimeZoneOffset(),Minutes),
- DateTimeValue(EndDatePicker.SelectedDate & ” ” & TimeValue(
- Required Attendees are users so need to send email id with comma separators like
- Concat(RequiredAttendess.SelectedItems.Mail,Mail & “;”),
- You may get property like builtinicon:Mail, this means not accessing right property
- For Example, Concat(RequiredAttendess.SelectedItems.Email,Mail&”;”). It should be
- Concat(RequiredAttendess.SelectedItems.Email,Email&”;”)
- Set DisplayFields and SearchFields for the Combobox
- [“DisplayName”]
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
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
How can i add an attachment to the invite?
No option to send an attachment with an invite.
Is there now a solution for attachement documents ?
As per my knowledge, no attachment supported.
Refer: https://learn.microsoft.com/en-us/connectors/office365/#create-event-(v4)
Hi
i have a question regarding time picking, what type of input form did you use for it?
BR
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”]
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
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”
),
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.
Hi Emily,
Please create a service account that has more access (Privileged). Update the connector with that service account.
Thank you for replying so quickly!
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.
Hi C,
I hope all day calendar event is covered in this post: https://learntoilluminate.com/2022/11/powerapps-create-an-all-day-calander-event-for-microsoft-group/
Please check section “Scenario 2:”
Please let me know if still an issue.
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!
Hello Cindy,
I’m delighted to hear that my blog was helpful to you. Thank you for your feedback!
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.
Collect the user input for Day, Month, and Year separately, and convert it into a unified format based on your tenant’s settings.
Can I have the full zip package of this app?
I lost the environment, and I may need to create again.
Hi Sir,
My requirement is to create a bulk events at once for logged in user with 1 hour difference in PowerApps using something similar what you have created. Please reply and suggest things which I will have to do to achieve it.
Sorry for the late response. Loop through your start and end dates. For example, your loop should start from the start date and increment by 1 hour until it reaches the end date and time.