1

I wonder if you can help me here.

How would I preserve the Modified date when a list item is changed?

I’m trying to create an archiving solution* using a workflow to copy older items to a second list, as follows:

I have two lists, each with identical columns. A workflow, running on the first list, sets LastModified column to the Modified date.

Archive Date is a calculated column which adds 30 days to the created date (=created+30).

The workflow has a Pause command so when the Archive Date is reached the item is copied to the second list archiving items older than 30 days.

The workflow then deletes the original item on the main list.

As an aside, when the item is copied, the original created date won’t be retained on the second list – to preserve this, the created date is saved to an ‘original creation date’ field via the workflow.

[*The archiving could be done through a list retention policy – however I can’t get this to work, either by moving items to the recycle bin or by triggering a workflow from the retention policy to copy items to a second list]

The workflow is set to run on created and changed.

Do you have any suggestions how to preserve the Modified date?

Thank you!

3

If you would move instead of copy the list item, you could use Calculated Columns. Why? Because infamously calculated columns do not update unless the item itself is updated. Therefore you could store the [Modified] as a Calculated Column which would retain the [Modified] value as requested.

In fact, it's possible you wouldn't even need need the calculated column if your Workflow would only move the list item, as it likely will trigger only SPListItem.SystemUpdate method.

  • Thanks moe. As far as I can see there's no 'move' command on Workflows, only copy and delete. I have tried to use a Calculated column, but this has a similar problem whereby the value will get changed when the modified date changes. What formula would you suggest to use? – Albini's cat Jun 30 '17 at 10:27
2

I understand the situation you are facing, I am assuming you are having two list "A" and "B" where B is the archive list. I would recommend you to create 2 extra columns in list "B" namely Created_A and Modified_A; Both of string type.

Since you are running the workflow on item created and Changed, Hence you should create two workflow variable say var_created and var_modified . So during initial phase of your workflow capture these values to your variable and then later update in both of the extra fields created under list "B"

Hope it helps!

PS: If you can share the workflow also, we can provide exact solution for this

  • Thanks DvG. That's pretty much it. However, the problem I have is the modified date will always get overwritten when the item is changed by the workflow. How can I retain the original modified date when the workflow copies/deletes the item between the lists? Ideally I want the modified date to when the item was naturally modified, not the time/date when it was moved to the second list. – Albini's cat Jun 30 '17 at 10:30
  • Sorry for the delayed response!. This is why I asked you to create extra fields.. so that you can put condition in such a way (if modified_A is empty then only store the value otherwise skip this operation ). Hence your modified data will not be overwritten – DvG Jul 1 '17 at 14:01
  • Hi DvG. Do you have a suggestion for the condition statement so I can understand what you refer to? Thanks. – Albini's cat Jul 3 '17 at 8:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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