I have 2 workflow, and am trying to pass association data from Parent to Child. I don't see how to access the association data in the child workflow. Can anyone help with this?
Hi Roger Brown,
There are two ways this can be done that I know of. One is to store the data in a field in the underlying list. The other is to use the Store Data and Retrieve Data Workflow Actions.
Patrick Kelligan, the problem is that the child workflow runs on a separate list from the parent.
I will check out the store and retrieve actions.
Patrick Kelligan, if I could access the Workflow Instance ID it seems that I should be able to access the association data that I setup in the parent wf. I mean, what is the point of association data except to pass data from one workflow to the other? Maybe I'm missing something.
You could try setting up an itermediary list that will hold the data for you. Create a key that the other workflow would recognise, either a composite key or use the workflow instance ID as you mentioned in your post. Just thinking outloud.
o can get the Workflow Instance via the workflow context. For example, load it to a variable as in the screenshot below.
, so I load the wf instance ID into a variable in the parent wf. How do I then access that variable from the child wf? All instructions I've read say to do this or that in the parent wf, then just retrieve that value in the child. But they don't say HOW to retrieve in the child.
you have to configure child workflow's variables that should accept inputs from parent workflow as 'Show on start form'
then, if you use Start workflow action to start child workflow, they will appear on action's configuration dialog and you will be able to configure what data to hand over.
if you use web service call to start child workflow then association data has to match variable names from child workflow.
, I am using the call web service to start the child workflow. I've got the variable in the parent and child workflows to be the same name. I am passing that variable in the association data, and the variable on the child workflow is shown on the start form. But the variable in the child workflow is not picking up the value.
The association data in the call web service action on the parent WF:
The variable on the child WF start form:
and what's the content of TXT variable in parent workflow?
that's important, its name doesn't matter - it need not be the same as in child workflow.
but the content has to reference child workflow's variable.
The content of the variable is a date in text format.
How do I get the variable in the parent workflow to reference to the child workflow's variable?
no, this doesn't work this way.
within single Association data field you have to be able to handover values for all the variables/input parameters of child workflow.
so there is predefined XML structure in which web service accepts all the inputs and you have to follow it.
see documentation how to work with association data field - https://help.nintex.com/en-US/sdks/sdk2013/#Operational/SDK_NW_OPS_WorkflowsAssocData.htm
pass data to child workflow
The Input to "associationData" parameter should look like this:
<Data><Variable1>Value</Variable1><Variable2>Value</Variable2></Data>
You must use "Call Web Service" and must have checked the checkbox "Encode inserted tokens".
As I'm experienced, when you don't check this box or if you using "Web Request" action and you will try to manually encode this string (i.e. via Inline Functions) "Call Web Service" and "Web Request" wil trow error 500.
I think this is bug in this actions.
Thanks . That clarification is helpful! I'm not really a coder so when it gets to this level I'm often at a loss.
why don't you then use OOTB start workflow action?
it would be much simpler...
Because (if I remember correctly) you can use this action only within the same list or web, if you need to start workflow in different list, you cannot use this action.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.