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 / add event to users cal...
Power Apps
Answered

add event to users calendar

(0) ShareShare
ReportReport
Posted on by 353

I have an app that lists corporate events. It is driven from a sharepoint list with start and end dates.
I would like the users to be able to click a button in the app and add the item to their o365 outlook calendar. 

I thought I got it working with the Office365Outlook connector, but unfortunately it will only add the item to the user that was configured for the connector (me). If another user logs into the app, it will always add to my calendar. 

Can anyone else suggest how to do this? Maybe using powerautomate?

 

 

Set(varUserCalendarId, 
 LookUp(Office365Outlook.CalendarGetTablesV2().value, 
 name="Calendar").id
)
;
Office365Outlook.V4CalendarPostItem(
 varUserCalendarId, 
 
 ThisItem.Title, 
Text(DateTimeValue(ThisItem.'Start Time'),DateTimeFormat.UTC), 
Text(DateTimeValue(ThisItem.'End Time'),DateTimeFormat.UTC), 

 "UTC"
)

 

 



nick9one1_0-1703872058905.png

 

Categories:
  • Verified answer
    Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    I would try using a Power Automate Flow that is triggered by the Power App, so the connection runs in the user's Security context.  It may still be a problem if you don't retrieve the Calendars using Get all Calendars and then use the ID for the main Calendar of that user. Otherwise it will still try to use the maker's calendar.

  • eisuan Profile Picture
    146 on at

    @nick9one1 

    I have a solution for you. Tested with my buddy and worked.

    This code goes on button, not in Gallery. On production mode this will go when app starts.

    Set(varUserCalendarId, 
     LookUp(Office365Outlook.CalendarGetTablesV2().value, 
     name="Calendar").name
    )

     

    In Gallery button to add even:

    Office365Outlook.V4CalendarPostItem(
     varUserCalendarId, 
     
     ThisItem.Title, 
    Text(DateTimeValue(ThisItem.'Start Time'),DateTimeFormat.UTC), 
    Text(DateTimeValue(ThisItem.'End Time'),DateTimeFormat.UTC), 
    
     "UTC"
    )

     

    Let me Know if it Worked for you.

  • nick9one1 Profile Picture
    353 on at

    this is almost the exact same code I originally posted.  It doesn't work because it uses the outlook calendar of the user that created the powerapp. 

  • nick9one1 Profile Picture
    353 on at

    thanks, I got it working like this;

    nick9one1_0-1704202033879.png

     

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 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard