@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!
@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!
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,
WarrenBelz
89
Most Valuable Professional
MS.Ragavendar
60
stampcoin
48