0

I have implemented a document library in which a person assign a document to review to a responsible person. He assigns it selecting his name from the Responsible column. Then an email goes to that person to review it. If he doesn't review it then the creator of the document again assign the document to a responsible person and son till he review it. I have implemented all these things in workflow.

In addition, I want a history column that stores all the dates when the creator has assigned the document. For example, a creator assigns the document first time on 19 October 2016 and the responsible person does not review it. Then the creator again assigns the document on 23 October 2016. I want to store all the dates such as 19 October 2016 and 23 October 2016 dates as a history in a separated column in the document library.

enter image description here

1

You can achieve this through the same workflow you use to send the emails.

Add a multi-line text column to the library to store the history. When the workflow runs, store the current value of the field in a workflow variable. Then set the field value to be the workflow variable plus the new information.

For instance, if you have the workflow set to run on item updated, the logic could be something like this (pseudo-workflow-code, but you get the idea):

Set [Workflow variable: previousHistoryValue] to [Current Item: HistoryColumn]

If [Workflow variable: previousHistoryValue] is empty 

    Set [Current Item: HistoryColumn] to [Current Item: Modified]

Else 

    Set [Current Item: HistoryColumn] to "[Workflow variable: previousHistoryValue], [Current Item: Modified]"

As you can see, I am using a comma to separate the values, but you can use whatever you want.

Also, of course, you might need some extra logic in there to determine if the history column needs updating at all.


In order to check if a variable is empty, select the condition "If any value equals value", select the variable you want to check as the first value, and then click on the word "equals" in the workflow step. You will see a menu that gives you several different comparison options, one of which is "is empty".

screenshot of workflow menu

  • Thanks Dylan for replying, it seems a good solution. But can you tell me how I can define (If workflow variable = "Empty")? It seems there is no option to define workflow = empty. – Narinder Chauhan Oct 20 '16 at 9:49
  • @NarinderChauhan updated my answer. – Dylan Cristy Oct 20 '16 at 13:22
  • I did this but SharePoint does not allow me to do this. As you have to enter something in 'Value' and when I select by clicking on 'equal' word with 'is empty' it does not change. It gives me an error on 'Value' if I can't define it. – Narinder Chauhan Oct 20 '16 at 13:32
  • I did this now and it works, sorry for the previous comment. I confirm your recent comment was right. :) – Narinder Chauhan Oct 20 '16 at 13:35
  • 1
    Hmm, not sure what is going on there. You definitely have to enter something for the first value, but after you enter something for the first value you should be able to choose "is empty" from the menu, and then the second value will disappear. – Dylan Cristy Oct 20 '16 at 13:35
3

You can use Multiple line of text with selected Append Changes to Existing Text. Every time you set this column it will show information about the change (modified by, modified date and value itself). Unfortunately this can be done only in a list and not in document library.

enter image description here

  • Hi Lukas, I applied this method by using 'update history column in this list' in workflow. But I am able to see only latest date and time in the multiple line text. – Narinder Chauhan Oct 19 '16 at 15:54
  • 1
    Oh, sorry, I forgot, that you need to enable versioning. – Lukas Nespor Oct 19 '16 at 15:58
  • It is alright Lukas. I have turned on the versioning but it is still not the same as it appears in your screenshot. I have uploaded my screenshot you can see above. – Narinder Chauhan Oct 19 '16 at 16:12
  • 1
    It seems that Multiple line of text behaves different in list and in document library. In document library there is no option to Append Changes to extisting text. Probably there is no OOTB solution for this scenario. You would have to append the values yourself in workflow. Create variable, append information that you need and set it to the field. – Lukas Nespor Oct 19 '16 at 16:18

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.