Skip to the content Skip to the Navigation

Workflow Excellence

  • Workflow Excellence
  • Blog
  • Contact
Blog
  1. HOME
  2. Blog
  3. Nintex Workflow
  4. Nintex Workflow – Archiving a List Item with Workflow History
December 30, 2020 / Last updated : December 30, 2020 Vadim Tabakman Nintex Workflow

Nintex Workflow – Archiving a List Item with Workflow History

When you copy an item in SharePoint to another list, you lose the workflow history. The main reason, is that the workflows that ran on the original item, don’t exist in the destination list.  Workflow history is linked to a specific workflow instance.

The process described in this post, is about getting the workflow history from an original item and specific workflow instance, and logging it to another workflow instance on the destination item.  Not the ideal solution, but it’s better than nothing right?

What I’ve done though, is add the Workflow History logging into a User Defined Action.  That way, it is reusable in any workflow.  It also means you can reuse it multiple time in one workflow, to copy workflow history from multiple workflow instances.

There are number of ways to get this done.  In this example, the business process (workflow) executes all the actions it needs.  In the end of the workflow, it copies the current item to another list.  But there is one final action. It starts a workflow on the newly copied item.  It’s not a matter of just starting a workflow.  That workflow must take some input parameters (start variables).  These include the initial List Name, the initial Item ID and the current Workflow Name.  This is enough information for the destination workflow to then get the Initial workflows history, parse it and store in the new item.

The workflow above is a generic approval process.  But at the end of it, you’ll see the Copy Item and the Call Web Service action.  In order to start a workflow on the new item that was copied, those parameters that we pass in, are passed through a piece of XML called Association Data.

The nodes inside the Data node are named, based on the Start Variables in the destination workflow that we are starting.

The Call Web Service, to start a workflow on the new item, call the Nintex Workflow web service.

Notice above, that the destination list where our item exists, is called Archive.  This can be changed to your destination list.  The destination workflow, I’ve named “Get Source Item Workflow History Workflow”.  Finally, we put in our variable that contains the XML association data.  Don’t forget to check the box “Encode Inserted Tokens”.

Now it’s time to take a look at the workflow that runs on that destination copied item. 

The workflow is very simple.  You can of course extend this, because all it has is one action.  A User Defined Action is being used here.  So lets move to the UDA and see what makes up the logic of that.

This is not a complex User Defined Action.  This action has the same parameters as the workflow that is calling it.  The List name, Item ID and workflow name.  It then uses a Call Web Service action to again, call the Nintex Workflow web service, but this time we are calling the GetWorkflowHistoryForListItem.  This will get all the workflow history for that item, for a specific workflow. 

The results that come back are in XML form.  So we use the Query XML action to pull the data out that we need.

I do want to point out that workflow history is stored based on a specific workflow instance.  This process is going to take that workflow and now log it to a different workflow instance.  But that is the result of this process.  There’s no way to copy a workflow instance completely over to another list and another list item.  Hopefully, this is a nice workaround for you.

Downloads

Nintex Workflow 2013

Download the files

Categories
Nintex Workflow
Tags
Build Dynamic StringCall Web ServiceFor EachLog in the History ListNintexNintex WorkflowQuery XMLStartWorkflowOnListItem

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Nintex Workflow

Previous article

Nintex Workflow – Remove Duplicates and Originals UDA
December 30, 2020
Nintex Forms

Next article

Nintex Forms – Starting a Workflow and Waiting
December 30, 2020

Recent posts

Nintex Workflow Cloud and XML Complex Nodes

December 10, 2021

Nintex Workflow Cloud and XML as Temp Storage

December 9, 2021

Nintex Workflow Cloud – PadRight

April 13, 2021

Automating a Shadowing Program

January 14, 2021

Nintex acquires K2

December 31, 2020

Nintex Workflow Cloud – Archiving Documents

December 31, 2020

Goodbye SharePoint 2010 Workflows Online

December 31, 2020

Nintex Workflow Cloud – Math Power Component Workflow

December 31, 2020

Nintex Workflow Cloud – Looping

December 31, 2020

Nintex RPA – Processing Filtered Excel Data

December 31, 2020

Category

  • Drawloop
  • Nintex Forms
  • Nintex Reporting
  • Nintex RPA
  • Nintex Workflow
  • Nintex Workflow Cloud
  • Nintex Workflow for Office 265
  • PowerShell
  • Promapp
  • Tools
  • Training

Archive

  • December 2021
  • April 2021
  • January 2021
  • December 2020

Interesting Sites

Nintex
Simplifying Processes
Jesse McHargue
Around SharePoint
Haley Walsh
Kok Koon
Nicole Vesser

Copyright © Workflow Excellence All Rights Reserved.

Powered by WordPress & Lightning Theme by Vektor,Inc. technology.

MENU
  • Workflow Excellence
  • Blog
  • Contact