cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SOAP request for passing a variable to a workflow

Hey there,

I'm a little stuck with a current problem. I'm trying to pass a variable to a workflow. I have to admit I'm still kind of new to the whole ajax-stuff, so maybe I'm just making a really stupid mistake here but after hours of trying and googeling I'm still without a solution

Basically I have a variable in my Workflow called [newSubscriber]. I want the variable to be passed by my script. it would be great if that was possible. My request looks like this

var soap ='<?xml version=\"1.0\" encoding=\"utf-8\"?>' +

     '<soap:Envelope ...>+

      '<soap:Body>' +

          '<StartWorkflowOnListItem xmlns=\"http://nintex.com\">' +

            '<itemId>' + itemId + '</itemId>' +

            '<listName>' + listName + '</listName>' +

            '<workflowName>' + wfName + '</workflowName>' +

            '<associationData>'+

              '<newSubscriber>' + currentUserLogin + '</newSubscriber>' +

            '</associationData>' +

          '</StartWorkflowOnListItem>' +

       '</soap:Body>' +

       '</soap:Envelope>';

I tried it with <associationData> just <Data> inside or outside the StartWorkflowOnListItem-Tag, but it didn't work so far. It would be great if someone could tell me if what I want to do is possible and if yes what I'm doing wrong. Thanks in advance and

Greetings Chris

Labels: (1)
Reply
4 Replies
Workflow Hero

Re: SOAP request for passing a variable to a workflow

Why did it now work?

Have you get an error?

Some time the problem is about formatting your data

Accept as Solution Reply
Not applicable

Re: SOAP request for passing a variable to a workflow

Sadly I don't get an error Message. The Workflow is started, but the Data I try to pass in die SOAP-Request between <newSubscriber> won't be filled in the Workflow-Variable 'newSubscriber'

So the syntax itsself is correct like that?

Accept as Solution Reply
Not applicable

Re: SOAP request for passing a variable to a workflow

Start a Workflow using a Web Service

Thats where it is described that Data should be passed in the associationData Tag. However I get nothing. The variable just keeps beeing empty. No matter if i put the data like

<associationData><variableName>variableValue</variableName></associationData> or

<associationData><Data><variableName>variableValue</variableName></Data></associationData>

Hope someone knows what I'm doing wrong

Accept as Solution Reply
Workflow Hero

Re: SOAP request for passing a variable to a workflow

I was struggling with the same problem as the op.  Turned out the web service expects the association data to be xml encoded:

var soap = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                            "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
                              "<soap:Body>" +
                                "<mSmiley FrustratedtartWorkflowOnListItem xmlns:m=\"http://nintex.com\">" +
                                  "<m:itemId>" + item.id + "</m:itemId>" +
                                  "<m:listName>" + listName + "</m:listName>" +
                                  "<m:workflowName>" + wfName + "</m:workflowName>" +
                                  "<m:associationData>&lt;Data&gt;&lt;Comments&gt;"+comments+"&lt;/Comments&gt;&lt;/Data&gt;</m:associationData>" +
                                "</mSmiley FrustratedtartWorkflowOnListItem>" +
                              "</soap:Body>" +
                            "</soap:Envelope>";
0 Kudos
Accept as Solution Reply