cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Update SharePoint list when Calendar Event is updated/modified or deleted

Hi! I have a calendar on Outlook and I am wanting a SharePoint Events List to be updated when I update the Outlook calendar. I currently have this flow to add items to the events list when an event is created in Outlook, and it works: 

madelinelabouf_0-1669651743646.png

 

I'm wanting to create another flow that will update the event (such as the time or name) or delete the event if these actions are performed in Outlook. This is the flow that I currently have, however, it is failing when it's run. I think I am missing something: 

 

madelinelabouf_2-1669651931530.png

madelinelabouf_3-1669651997256.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

For the filter query, you need to use the internal name of the field you added to your SharePoint list. Internal names would not contain any spaces. You can easily get the internal name by going to your list settings and clicking on the field name. Then look at the end of the URL in your browser. The internal name will be after "&Field=". Use that value in the filter query and it seems like you should be all set.

View solution in original post

17 REPLIES 17
David_MA
Impactful Individual
Impactful Individual

I am guessing it is failing at the Update item action. The Id it is looking for here would be the ID in the SharePoint list and not the ID of the Outlook item. You need to move the Update item action into your Apply to each action and then use the ID from the current SharePoint item in the ID field. 

I moved the Update item action into the Apply to each action and changed the ID to the SharePoint item, however it still failed when I tried to update a time on an event. Here is my flow now: 

 

madelinelabouf_0-1669654317848.png

madelinelabouf_1-1669654439915.png

 

 

David_MA
Impactful Individual
Impactful Individual

What is the error message?

There's no error message, the flow saves fine. I'm just getting "failed" when I change the date of an event. 

 

madelinelabouf_0-1669655891663.png

 

If you click on the flow run, it should give you some kind of detail as to the error. For example, here are the error details of a flow that failed today for one of my users:

David_MA_0-1669656227861.png

I don't have any flows doing exactly what you are. But I was thinking it could be with populating the Start and End Time in your SharePoint list. However, you are using the same fields in your Create item action and you said that flow is not failing, so it would not make sense why it would fail if you used those to then update the item.

 

Ah I see, I didn't realize you could click on the flow run to see the error. It told me that the EventID in my Get Items didn't exist, so I removed that. 

 

This time the run succeeded, and the event I was testing updated its time, however it seemed to move all the other events I put on that SharePoint list onto the same day and rename them as the event that I'd changed (it's not a big deal because the original calendar is in Outlook). Do I need to have the Outlook Id in the filter query for Get Items?

 

madelinelabouf_0-1669657331212.png

 

Yes, you definitely need to keep your filter query on the Get items action. Otherwise, as you have seen, it will update everything in your list. With the filter query it should just return one item, and thus update one item only. However, Power Automate still needs to use an Apply to each action when using it with Get Items.

 

Is the EventID field not one you created in your SharePoint list. I just noticed in your Create item action you do not set this field to correspond to the Outlook ID and I don't see it listed as a field in the action. If the EventID is not something you added, you'll want to add a field to your SharePont list to populate it with the Outlook ID so you can establish a 1:1 relationship between your two lists.

Is something that I set up using a different flow? Or is this done in SharePoint? 

I am not sure what you are asking? To update only the one item in your SharePoint list that matches the Outlook calendar item, you need to use a filter query like you showed in your original post. If you are asking if this is done automatically, the answer is no. You need to set that up so there is a relationship between the two items. It is like setting up tables in a relational database using a unique key. 

My apologies, I am new to both SharePoint and Power Automate. 

 

What I'm asking is how to set up the EventID. I had put that in my filter query because I'd seen it on another post. You mentioned that I'll want to add a field to my SharePoint list; I'm not quite sure what you mean by that--is this done in the settings of the list on SharePoint? 

 

Thank you!

I made an ID column for the SharePoint event list and then added the following to the filter query: 

 

madelinelabouf_0-1669671452697.png

 

Is this the correct way to do it?

 

Maybe, I would need to see the fields in your event list. However, normally every SharePoint list has an ID column, so you should not be able to add another ID column to your list. I am not sure how to explain it any easier, but you need to create a column in your SharePoint list to store the ID of the Outlook calendar event. After the Outlook calendar even is created, you need to populate the Outlook calendar ID field (any name you want) in your SharePoint events list when you create the item. This will establish the 1:1 relationship between the Outlook calendar event and your SharePoint list item.

 

When your other workflow runs when a calendar event is updated or deleted, you would then use the ID of that item to filter the Get items action in your SharePoint list as you show above.

 

However, I did notice one other problem. For your second workflow, which you want to run when the calendar event is updated, you are using the wrong trigger. You want to use When an event is modified (V3). The one you are using will also run when an item is created. 

David_MA_0-1669726097470.png

 

I've figured out how to make outlook calendar field which I named Outlook EventID. Here is my updated flow that incorporates the added, updated, and deleted all in one: 

 

madelinelabouf_0-1669733673756.png

madelinelabouf_1-1669733730316.png

 

If yes expanded: 

madelinelabouf_2-1669733770504.png

 

If no expanded: 

madelinelabouf_3-1669733818694.png

madelinelabouf_4-1669734010983.png

 

It seems to be working for adding events. However, I'm getting an error message that says: 

The expression "Outlook EventID eq 'AAMkADM0YWM1NjQ2LTIxYWUtNDdhMC05Y2IxLTJjMTM2ODQwZTkxYgFRAAgI241rQVKAAEYAAAAAxURMwUKJIUaDJ1P082G1QQcAN6XbpWCckEq1DnA4xB8krgAAZQZTbAAAN6XbpWCckEq1DnA4xB8krgABBwPDWQAAEA=='" is not valid. Creating query failed.
clientRequestId: c2f3a33d-5b52-4680-a112-d21d1093a573
serviceRequestId: c2f3a33d-5b52-4680-a112-d21d1093a573

 

So it seems the problems are in both of my Get Items. 

 

 

 

For the filter query, you need to use the internal name of the field you added to your SharePoint list. Internal names would not contain any spaces. You can easily get the internal name by going to your list settings and clicking on the field name. Then look at the end of the URL in your browser. The internal name will be after "&Field=". Use that value in the filter query and it seems like you should be all set.

The url I have ends in &Field=Outlook_x0020_EventID, so would I use Outlook_x0020_EventID or leave out the part in the middle?

You would use this in your filter query: Outlook_x0020_EventID

Awesome! It works just how I want it to now, thank you so much for your help and patience!!

 

Here is my final flow: 

madelinelabouf_0-1669748327963.png

If yes expanded: 

madelinelabouf_1-1669748369400.png

If no expanded: 

madelinelabouf_3-1669748457557.png

madelinelabouf_4-1669748485257.png

 

If anyone else needs help on creating the Outlook Event ID I found the instructions on this link: 

Solved: SharePoint Calendar and Events - Power Platform Community (microsoft.com)

 

 

 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (5,676)