I would like to create a workflow that runs in a library. This workflow will look at the date of the creation of the document and then based on if it is 3 days old, it will take that document, move it to another library and then delete it from the first library.
I have so far got to the point where I can select one document and it runs. But, I am not sure what kind of looping I need. Not sure if I need to run through the library and collect all documents which meet the criteria, then run. Or run for each...
This is what I have so far.
I am learning about looping, but I get a little tangled up when trying to set variables and building a list. Any help is appreciated.
Solved! Go to Solution.
I would do the following:
However, please have a look at SharePoints retention policies and see if they aren't what you looking for.
Philipp Lucas am I correct in thinking you are describing a site workflow above?
An alternative option is to have a workflow that runs in the library on every item created, waits for 3 days, then does the copy and deletion?
Yes, you are correct. I was talking about a site workflow. I would chose a site workflow over a list workflow here because it can reduce the number of running workflow instances significantly. The more workflow instances we have running, the more errors can occur. Besides it gets more difficult to evaluate/analyze the workflow. Always try to keep it simple
In your comments, you say I should use a For Each loop to put the current id into another variable. What type should I make this variable (i.e. collection, list item ID, etc.)?
variable should be of type list item ID or single line of text (my favorite). Not sure if number and integer would work. A collection variable won't work, because you cannot put one single value of a collection into another collection.
Glad to hear it, Mark Jason Williams! Can you please click the "correct answer" button beneath one of Phillip's most-helpful replies?
Your community manager