0

I have a Sharepoint List with a Flow that automatically creates a Doc Set in a Library when a new List Item is added, with the the columns from the list item populating the columns in the Doc Set.

I am trying to also make it so that if the list item is updated, then the columns in the Doc Set are also updated.

At the moment I am trying to use the same Flow to cover off on both actions (Trigger: When an item is created or updated), the Flow has a condition that creates the Doc Set if the list item is version one and updates the Doc Set if it is not version one.

The creation path is working perfectly. But I can't get the update path to work.

Any help greatly appreciated.

1 Answer 1

0

The key thing to remeber her is that in order to make your update easy, the list item that is driving the creation of a new Doc Set has to know which Doc Set to update if it needs to make an update. In order to do that, you can make your own sort of lookup column to store the ID of the item (Doc Set) in the other list that needs to get updated.

In the past when I have had to keep things in multiple lists in sync, I have taken the following approach (and this works without even having to keep track of the version number of the original list item):

  • In the first list, add a number column, maybe call it LinkedDocSet (or whatever makes sense to you).
  • Have it default to 0.
  • When your flow gets triggered, have it check to see if LinkedDocSet is 0 (or null).
  • If it is 0 (or null), create the new Doc Set, and copy the column values over.
  • Then, get the List Item ID of the new Doc Set, and populate the LinkedDocSet column of the original list item.

Now your list item knows which Doc Set it is "attached to". Then, when the workflow gets triggered again:

  • Check to see if LinkedDocSet is 0 (or null).
  • If it is, create a new Doc Set (as above).
  • If it is not 0 (or null), get the Doc Set in the other list by using the ID stored in LinkedDocSet.
  • Update the column values.

Obviously you will want to put some error handling in there to handle the case where someone might have deleted the Doc Set, in which case the item ID stored in LinkedDocSet will be invalid. What you decide to do if that happens is up to you, but you definitely want to handle that and prevent the flow from failing if you run into that situation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.