cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JosuOte
Frequent Visitor

Updating event in sharepoint when element is modified

Hi, 

 

I currently have a flow that creates an event in sharepoint that we use for calendar, so when a new entry is done in a certain list, the event will be created. The issue comes when instead of creating, someone needs to modify the element. The flow is triggered with "when creating or modifying element" so it will create a new event but the old one will still be in the calendar. What I need to achieve is either being able to modify a currently existing event or create a new one and delete the old one. 

 

This is how the current flow works(only creates when creating or modifying, no update or delete done yet, the created elements are created one day appart, both need to be replace for the new ones):

flow1.PNG

 

It's okey if this needs 2 different flows to be achieved. What I was working with is using the "ID" in one of the titles in order to be able to retrieve that same ID in the flow I was trying to make to update it.

 

Is it possible? If more information is needed feel free to ask.

 

Thanks in advance,

 

Josu.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @JosuOte 

 

Columnname would just be the name of the column in your list that you might use to store the unique event number. 

 

If you use a list to generate the events, each item has a unique ID, you could store the ID in the event list when the item is created and then look for that ID when it comes to doing an update or new?

 

So if you create a column called FirstListID in your event list, you can filter on FirstListID eq 'dynamic value for trigger list item id' when performing the get items action.  If length is greater than 0, it exists and you update, if not you create new.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

View solution in original post

4 REPLIES 4
DamoBird365
Super User
Super User

Hi @JosuOte 

 

What makes the calendar item entry unique that would allow a cloud flow to identify it from your trigger?  If you can perform a get items action with a filter columnname eq 'dynamicvalue' and then use a condition where length() of value from get items is greater that 0 i.e. there is a match, yes branch you update the existing item, no branch you create a new.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

Hi @DamoBird365 

 

Thanks for the response, 

 

I have a couple of questions. The calendar item itself doesn't have anything that can make it different from another item 100% of the times. Could I create an automatically made ID of some sort in the "create element" or similar block? If so, I could use that as reference for updating the element. 

 

And the other question is, when you refer to "columnname" what exactly are you referring to?

 

Thanks for the help, 

 

Josu.

Hi @JosuOte 

 

Columnname would just be the name of the column in your list that you might use to store the unique event number. 

 

If you use a list to generate the events, each item has a unique ID, you could store the ID in the event list when the item is created and then look for that ID when it comes to doing an update or new?

 

So if you create a column called FirstListID in your event list, you can filter on FirstListID eq 'dynamic value for trigger list item id' when performing the get items action.  If length is greater than 0, it exists and you update, if not you create new.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

View solution in original post

Hi @DamoBird365 

 

Took me longer than expected, but it finally worked, the event now gets updated if it already exists and is created if it didnt already exist. 

 

Thank you very much for the help, really appreciated.

 

Josu

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,499)