Store Data and Retrieve Data Workflow Actions

Document created by Champion on Jun 23, 2014
Version 1Show Document
  • View in full screen mode

For both actions, the Store Data and Retrieve Data, you need to tell them which workflow instance to use.  Every time a workflow runs, it is given an instance ID.  If you were to run a workflow, navigate to the workflow history and then look in the address bar in Internet Explorer. The number at the end is the WorkflowInstanceID.


Store Data

You can store data in the current workflow instance, or you can specify a workflow instance ID using a variable. Then you give it a key and a variable which contains the data.


Think of it as a dictionary to which you are providing definitions.



“Key1” = “My data”

"Key2” = “Their data”


To get the information you need, you use a RetrieveData action, and if you need the value of Key2, that’s what you ask for and you will get “Their data”.


A good example is your scheduled workflow.


The workflow would run, and then you use a Store Data action, which is configured to store data in the current workflow instance. It would store the result in a key called “MyResult”.


Retrieve Data

This action works almost identically as the Store Data, but in reverse.


Here you specify the current workflow instance, or an instance ID; the key for the data you want to get back, and the variable you want to store it in.


In the above example using a scheduled workflow, rather than the current workflow instance, you’ll need to find the actual workflow instance ID of that scheduled instance run.


For the item the scheduled workflow is configured for, add a hidden field and store the Workflow Instance ID in your Scheduled Workflow. Then in your List workflow, you can use a Query List action, get that workflow instance ID and use that in the Retrieve Data action.


So the hardest part, is making sure you have the ability to get at the Workflow Instance ID for the workflow instance that has stored the data.

1 person found this helpful