cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Madumi
Level: Powered On

V4CalendarPostItem - how to track event ID on calendar shared version

So... I am using V4CalendarPostItem to create an event on a shared calendar. Upon posting the event, I can record the event ID from the data the connector returns. This event ID however is unique only to the user who is logged in.

 

I would like other users of this shared calendar to be able to delete the event, but I notice that when a different user logs in, both the calendar ID as well as the event ID on their version of the shared calendar is completely different. i.e. I cannot use these ID's within CalendarDeleteItem_V2 (those ID's no longer apply).

 

I am figuring I could write a GUID to both a field on the calendar event, as well as a database used for tracking these events, but where can I store this GUID? "Subject" and "Body" seem to be the only fields I can write to... So I guess I could inject a GUID somewhere at the end of the "Body" field & use this for tracking... but this seems clumsy.

 

Can anyone think of a good way to uniquely identify calendar events for deletion when they are viewed by different users on a shared calendar? eg. I need to be able to track the calendar event even when a user moves the event, changes the subject, or enters extra data in the body... any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: V4CalendarPostItem - how to track event ID on calendar shared version

Hi @Madumi ,

Based on the issue that you mentioned, I have made a test, and the issue is confirmed on my side. When different users log in this Shared Calendar, the Event Id would be different for each one.

 

As an alternative solution, I agree with your thought almost. You could consider generate a unique GUID value within the Body of the Event, when the other users want to delete this event from this shared Calendar, they need to filter the specific event from their side based on the generated Unique GUID value, then execute the CalendarDeleteItem_V2 function.

 

Add a Dropdown control within your app, set the Items property to following:

Office365Outlook.CalendarGetTables().value

set the Value to DisplayName column.

Note: You do not need to care about the change of the Shared Calendar Id. When different user run your app, the Dropdown box would list available Calendar tables based on current sign in user's credential, so they just need to select the proper Calendar name from above Dropdown box.

On your side, you should generate a unique GUID value when you create a event in this Shared Calendar using the following formula:

Set(UniqueGUID, GUID()); // use GUID() function to generate unique GUID value
Office365Outlook.V4CalendarPostItem(
                                   Dropdown1.Selected.Name, // Type your Shared Calendar ID here
                                   "Event Subhect Here", 
                                    Now(), 
                                    DateAdd(Now(), 30, Minutes),
                                    "(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",
                                    {
                                      body: "Type Body Text Here <br>" & UniqueGUID // Type the UniqueGUID variable here
                                    }
);
.... type formula to patch the generated GUID value back to your database for tracjing this event....

Then when these other users want to remove this Event from this Shared Calendar, they need to find the specific event from this Shared Calendar on their side based on the specific unique GUID value (stored in your database):

Office365Outlook.CalendarDeleteItemV2(
                                     Dropdown1.Selected.Name, 
                       LookUp(Office365Outlook.V4CalendarGetItems(Dropdown1.Selected.Name).value, "Type specific guid value retrieved from your event tracking database" in body).id
)

 

Currently, within PowerApps, I afraid that there is no other simple solution to achieve your needs. I think above solution maybe the only available solution to achieve your needs.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: V4CalendarPostItem - how to track event ID on calendar shared version

Hi @Madumi ,

Based on the issue that you mentioned, I have made a test, and the issue is confirmed on my side. When different users log in this Shared Calendar, the Event Id would be different for each one.

 

As an alternative solution, I agree with your thought almost. You could consider generate a unique GUID value within the Body of the Event, when the other users want to delete this event from this shared Calendar, they need to filter the specific event from their side based on the generated Unique GUID value, then execute the CalendarDeleteItem_V2 function.

 

Add a Dropdown control within your app, set the Items property to following:

Office365Outlook.CalendarGetTables().value

set the Value to DisplayName column.

Note: You do not need to care about the change of the Shared Calendar Id. When different user run your app, the Dropdown box would list available Calendar tables based on current sign in user's credential, so they just need to select the proper Calendar name from above Dropdown box.

On your side, you should generate a unique GUID value when you create a event in this Shared Calendar using the following formula:

Set(UniqueGUID, GUID()); // use GUID() function to generate unique GUID value
Office365Outlook.V4CalendarPostItem(
                                   Dropdown1.Selected.Name, // Type your Shared Calendar ID here
                                   "Event Subhect Here", 
                                    Now(), 
                                    DateAdd(Now(), 30, Minutes),
                                    "(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",
                                    {
                                      body: "Type Body Text Here <br>" & UniqueGUID // Type the UniqueGUID variable here
                                    }
);
.... type formula to patch the generated GUID value back to your database for tracjing this event....

Then when these other users want to remove this Event from this Shared Calendar, they need to find the specific event from this Shared Calendar on their side based on the specific unique GUID value (stored in your database):

Office365Outlook.CalendarDeleteItemV2(
                                     Dropdown1.Selected.Name, 
                       LookUp(Office365Outlook.V4CalendarGetItems(Dropdown1.Selected.Name).value, "Type specific guid value retrieved from your event tracking database" in body).id
)

 

Currently, within PowerApps, I afraid that there is no other simple solution to achieve your needs. I think above solution maybe the only available solution to achieve your needs.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,134)