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 / Is there a way to save...
Power Apps
Unanswered

Is there a way to save the eventID of a calendar event after creating it?

(0) ShareShare
ReportReport
Posted on by 293
Hi! to give a little context I created an app that manage calendar.
It has it's own calendar but my client wants to also use Outlook calendar so this app has the same data in Outlook calendar and in sharepoint (I'm using SP lists as datasource).

Now, one thing that's problematic is to edit and delete already created events from the app since you need the eventid.
My cuestion is if there's a way to immediatly save the eventid after creating it using the Office365Outlook.V4CalendarPostItem function in powerapps so I can Patch my SP list items with that ID to later use it in case of needing edit or delete the event
Categories:
I have the same question (0)
  • v-yutliu-msft Profile Picture
    on at

    Hi @FacundoGorla ,

    Do you want to get the event id that you last created?

    If so, I suggest you get events by using V4CalendarGetItems function, and then sort the result based on created time.

    The last item's ID would be the event id that you want.

    Try this:

    Last(Sort(Office365Outlook.V4CalendarGetItems(Calendar id).value,createdDateTime)).id

     Please replace Calendar id with the Calendar id when you create the event.

    You could use this to get the calendar id:

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

    Or filter based on other name, like "Birthday","Holiday",etc.

     

     

     

    Best regards,

  • FacundoGorla Profile Picture
    293 on at

    @v-yutliu-msft wrote:

    Hi @FacundoGorla ,

    Do you want to get the event id that you last created?


    Yes!

    I'll try that and get back to you. The main thing is that I onyl want the last one so I want to limit the amount of event I "load" with the getitems. I guess I have to limited that with the Createddatetime. I'll see what I can do and get back if I have any issue.

    Just to comment, my way of solving it was making a colection with all the SP list items that don't have an eventid, then in another gallery I would have all the calendar events with the same name.
    Then i would patch the items getting the id from each element using a lookup function 


    Thanks, as always, for the answer!

  • hkmamun Profile Picture
    106 on at

    @v-yutliu-msft  Can you please tell me what will happen for below situation,

    Lets say, I am creating event from Power App by using Office365Outlook.V4CalendarPostItem() function, after that I am following your process to get the last created Event ID with below code

    Last(Sort(Office365Outlook.V4CalendarGetItems(Calendar id).value,createdDateTime)).id

    so when the upper code is processing that time another event is created in my calendar from outside the app (may be from outlook desktop client or outlook online web or someone invite me for a meeting)  and it was created before few millisecond while the upper code executing . So in that case which Event's ID the upper code will return.

     

    Thanks!

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard