I have two lists. list A copy items to list B. When a item in list a is updated, it copy the item to list B with a different ID. I want to delete the old item in list B and keep the updated item with the new ID.
something like this?
consider current item to listA and testlist listB
As per my understanding:
You may be using the "Create Item Action" for both Item creation and Item update condition .I may have tried the following option
1)I would create a Column "Flag" in "ListA" whose initial value would be 0 but as soon as the items gets copied in the ListB I would set it to 1,In my code will include "Switch" condition in the beginning to check if"Flag" is 0 or 1 ,if its 0 then use the condition "Create" item if its "1 " use the condition "Update item" you would have some column i.e "Title" which can be used in Where condition. With this technique your items would remain in sync and new item would be created in ListB only once
2)If you want to create nmultiple "Ids" for the same item in ListB then use delete condition to delete item in ListB by using "Title" in Where then create a new item
It sounds like each time the item in List A is changed you want to create or update the item in List B. The Copy Item function creates and overwrites. The overwrite ability will keep the ID intact and also not increment versions.
I tried "Copy Item" few days back but I observed that it created new items in other list every time instead overwriting it
Really? Was the title changing?
No, We have the same title but multiple items in another list and "Overwrite the existing item" is also checked in the workflow
That was really surprising for me,but copy items action when trigerred both in case of item create/Update will create multiple items for each update
My variant. Create field in list B named "ID". It will contain id of copying item from list A. All items in list B will know from where it was copy. And before copy delete all items with same id of copying item.
Sorry for my English. I hope my words make sense.
Why dont you try the solution that I have given,It worked for me and I am using that
How your process will know which item in list B should be updated?
Are you updating all the columns? I guess atleast Title or some other column will be unique.If its not unique then add one column in ListA named "ItemID" and create a workflow in ListB to update "ItemID" in ListA with ID of ListB,By this your ItemID in ListA would be in Sync with ÏD of ListB so u can easily update
Retrieving data ...