1

The Question
Is there a way, either through a hack or an action I haven't noticed, to clear the value in a specific field of an item, using a workflow?


The Issue
All I want to do is clear the values in my Archived Date and Archived By fields (see The Setup,) but I can't find a Clear Field in Current Item action, and I can't leave the Value blank in a Set Field In Current Item action.



For More Information:
The Setup
I am building my workflow in SP Designer

I have a document library, and I want to be able to Archive documents, rather than delete them. To this end I have added an extra value to the Status lookup I already have in place; Archived.

I have then set up a workflow that adds some data to the record to track who archived it, and when. I have the following fields:

  • Archived Date [Date Content Type]
  • Archived By [Person/Group Lookup Content Type]
  • Archived Data Updated [Yes/No Content Type]

The Archived Data Updated field is used by the workflow to detect whether or not a document updated with the Status set to Archived has already had these values recorded; to stop it from overwriting.


The Requirement
So I want to enable users to "unarchive" a document, returning it to Live status. And when this happens I want to clear the Archived Data fields, and set the Archived Data Updated field back to No.

I have the logic laid out: Workflow Logic

  • Are you creating this in Designer or via code? If it's the latter, there's a pretty quick and easy way to do it. Then again, if it's the latter, you're writing code. – NotVonKaiser Jul 30 '13 at 16:11
  • In Designer @JohnCraven, I don't have access to Visual Studio – CLockeWork Jul 31 '13 at 9:39
3

If you are using the Designer, you can use the Action "Update List Item" and set your Archived By to nothing (see below). As for clearing the Archive Date, I set up a DateTime column that has a default value of "(None)". You can have that in another list (I put it in a list called "test", which has only one item). Then you can use that to clear the date from your Archive Date (as I did in the screen capture).

enter image description here

  • Thanks Frank, I don't supose there's a smoother way to do the date? I'm leaving soon and would rather not have such a complex solution in place. Also, for the set user to nothing bit; I can't access that link in work, but I'm assuming you mean enter the value "" in the Value field? That works fine for me :) – CLockeWork Jul 31 '13 at 9:53
  • Hi @CLockeWork, you can leave the Archive Date blank, which sets it to '1900/01/01', although I find that displaying the date as 01/01/1900 in views not elegant. You can conditionally format/display if blank or 1900/01/01. – Frank Fajardo Aug 4 '13 at 2:16
  • Thanks for your help @Frank, and sorry to keep coming back on this; I can't see a way leave the Archive Date blank, if I add no value then the workflow returns an error. – CLockeWork Aug 5 '13 at 8:31
  • 1
    Try creating a workflow variable, leave it uninitialised and use it in the Value. – Frank Fajardo Aug 5 '13 at 11:51
  • Thaty should do it, cool, thanks for your help @Frank – CLockeWork Aug 5 '13 at 13:29

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.