none
How to tell what version of a document the workflow ran against? RRS feed

  • Question

  • I am using the OOB Approval workflow and in the workflow information I see a Document field, but that links latest version of the document. How can I tell what version of the document the workflow actually ran against?
    Tuesday, March 10, 2015 10:03 PM

Answers

  • Hi,

    Set a variable in the workflow to be equal to the version of the document.

    Now you can use this variable to update a column in the document library with the version and date the workflow was ran. Next time the workflow runs, update this column with next run details.

    OR write this variable to workflow history. Hope it helps.


    Regards, Kapil ***Please mark answer as Helpful or Answered after consideration***

    Wednesday, March 11, 2015 4:14 PM

All replies

  • Michael,

         Check the timestamp when the workflow started and then compare the timestamp of the different historical versions of the document.  Also, it's helpful to set the workflow to end when the document changes to prevent the workflow spanning across different versions of the document.

    thanks,
    Tony

    Tuesday, March 10, 2015 11:37 PM
  • Workflow instance would run on the latest (checked in, published) version of a given document/page.

    These postings are provided "AS IS" with no warranties, and confers no rights.

    Wednesday, March 11, 2015 1:55 AM
  • Yeah I get you can check timestamps. I was looking for something a little more auditable. I guess the best I can do is have the users type in the version number when starting the workflow.
    Wednesday, March 11, 2015 2:14 PM
  • Hi,

    Set a variable in the workflow to be equal to the version of the document.

    Now you can use this variable to update a column in the document library with the version and date the workflow was ran. Next time the workflow runs, update this column with next run details.

    OR write this variable to workflow history. Hope it helps.


    Regards, Kapil ***Please mark answer as Helpful or Answered after consideration***

    Wednesday, March 11, 2015 4:14 PM
  • I think I will have to do something like this. I was trying to avoid using a SP Designer workflow because when you have an OOB approval workflow, there is that startup window that lets the user change the approvers and add their own message to the approval. When you use the SP Designer workflow, you lose that ability. I think I can still create my own startup screen for the approval to accomplish this same thing though.
    Wednesday, March 11, 2015 6:08 PM
  • Hi Michael,

    You can use the OOB approval workflow. In SPD, right click on Approval workflow. It will give you an option to copy and modify. All the functionality remains the same and you can add the above step there.

    Once published, reattach this new workflow instead of Approval Workflow.


    Regards, Kapil ***Please mark answer as Helpful or Answered after consideration***


    • Edited by K-Joshi Wednesday, March 11, 2015 8:54 PM edited
    • Proposed as answer by K-Joshi Monday, March 30, 2015 1:03 PM
    Wednesday, March 11, 2015 8:53 PM