Update sharepoint calendar item when separate list item is changed


Badge +3

I have a list 'assess form' based on the information in that I have a super simple workflow to create a sharepoint calendar event.

How do I modify my workflow so that it will either update the calendar event IF the event fields change OR delete the old item and create a new one? (my preference would be to update the original if possible)

I am a fairly basic and beginner user so detailed explanations or screenshots would be insanely appreciated!

 

Thank you!!

4049i04ACBA4E173E4E0E.png


10 replies

Userlevel 6
Badge +22
Hi,

Its hard to give advice without knowing all the intricacies but in general I would leave your current workflow to run on item creation and have a second workflow that runs when the item is modified.

One thing to add on the first workflow is to retreive the item id of the item that is created. The create item action has this built in (Store new item ID in) so just capture the ID in a variable and then update your list with the ID. Create a column just for this if you have to.

When the item is modified use the ID in the list to update the related event and just update all columns so that you dont have to worry about working out what was changed.
Badge +3
Hi Simon, thanks for replying, appreciate the help.

I’m a real beginner user, how do I capture the ID in a variable?

I know it’s probably really simple but google isn’t helping much on this topic
Userlevel 6
Badge +22

Hi,

In the Create Item action select Variables.

4095i73EBCFE303417EAA.png

Click New:

4096iE22EF4093A660431.png

Select List item ID, give it a name, and click save.

4097iE1A443E2CBC5B55D.png

Now use the variable in the Create item action in the "Store new item ID in" Field.

4101i1F78FF1CC6564E1D.png

When the new item is created the action will store the item id of the new item.

You can update your list item with this ID. When you need to update the Calendar item you can reference this ID to make sure you are updating the correct item.

Badge +3
oh, I unknowingly did that already when I set up my create item.

Do I put the update item in the same workflow before the create item?

Do I have to set up a query list to search if that item id is used then update if it is and create if it's not?

Your help is greatly appreciated!
Userlevel 6
Badge +22
Hi,

First workflow (Starts on item creation):
Create Item action that creates the item on the calendar.
Update item action to save the item ID in a sharepoint column in the source list of the item that was just created in the calendar.

Second Workflow (Starts on item Modfication):
Update item action. It updates the calendar item where the Item ID is equal to the id that was stored in the column in the first workflow.
This makes sure that the correct item is updated. No query list required as the update Item action will lookup the correct ID.
Badge +3

4126iF7D3DEA3EF04AC4F.pngThanks so much for that, so where it has update I have 'engineering services site visits' this is the calendar I want the entry updated in. The 'where' field I'm a little unsure of? Is the above correct to update my calendar entry? I can't see a field 'list item ID' which is what I named my variable in the create item workflow?

Userlevel 6
Badge +22

Hi,

Your action for the second workflow would look like this.

I did this in SharePoint 2010 as based on your screen shot it looks like what you are using.

4127iAED4B9EC910AD5DC.png

Badge +3
Hi Simon,

I think I missed a step, 'the column where I stored the item ID from the first workflow'? I created the variable but I don't think it's linked to a column.

When I select 'current item' - 'ID' it moves a calendar entry to the date I specify but it's not the right calendar entry? it's a random one out of the calendar? So clearly I have done the IDStore wrong?
Badge +3

4131i74CBB6EC6AADD87F.png

 

This is what my create item looks like?

 

Userlevel 6
Badge +22
Hi,
In your first workflow after you create the item the action will return the Item ID of the item that was created in the Calendar.
Add a column to your list that can store this ID.
Next add an Update Item action in the first workflow that updates the column with the ID for the item that was just created.
You then use this column in your second workflow.
When the item is modified the workflow picks up the Calendar Item ID from the column and updates the correct item in the Calendar.

Reply