You can't, but you can do the reverse. Using the
Copy item action does not give you any useful return value to be able to reference the copied item. But, what you can do is add a number field (maybe called
OriginalItemID? And maybe make it hidden so that user's can't edit the value?) to the library where you are making the copies. Then, right after you have initially copied the document, set the copy's
OriginalItemID field to be the ID of the current item.
Then when the workflow runs again, you can find the copy based on the
OriginalItemID value matching the current item ID.
Sorry, my bad, my original answer is incomplete. (It had been a while since I did this, so I didn't remember all the steps.)
- First, on the list/library where you have the originals, you need
two number fields:
CopyItemID, both should default to zero.
- On the list/library where you have the copies, you need to add the
OriginalItemID field, and be sure it's named exactly the same as the field in the originals list.
- When the workflow starts, check the value of the
CopyItemID field on the original item. If it's zero, you know it's a new item and you need to make a copy.
- Before making the copy, set the
OriginalItemID field on the original item to be it's own (i.e. "Current Item") ID.
- Copy the item. The
OriginalItemID on the copy should now refer back to the original item's ID.
- Now look up the copied item based on the value of the
- Get the ID of the copied item and store it in the
CopyItemID field on the original item.
- The next time the workflow runs, again, first check the value of the
CopyItemID field. If it is not zero, you know you have a copy, and you know it's ID.