Skip to main content

Notifications

Community site session details

Community site session details

Session Id : SHDWY1SMnBDtwgBRT7CHST
Power Apps - Building Power Apps
Unanswered

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

Like (0) ShareShare
ReportReport
Posted on 10 Jan 2020 13:52:49 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:
  • hkmamun Profile Picture
    106 on 04 Jun 2020 at 08:01:57
    Re: Is there a way to save the eventID of a calendar event after creating it?

    @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!

  • FacundoGorla Profile Picture
    293 on 13 Jan 2020 at 12:02:10
    Re: Is there a way to save the eventID of a calendar event after creating it?

    @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!

  • v-yutliu-msft Profile Picture
    on 13 Jan 2020 at 03:47:34
    Re: Is there a way to save the eventID of a calendar event after creating it?

    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,

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 89 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 60

#3
stampcoin Profile Picture

stampcoin 48

Overall leaderboard