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.