Skip to main content

I'd like to use form values to create entries in a few other related lists. 

My first thought was to use the save button to trigger a site-level workflow however, I haven't yet tracked down the JavaScript to create a new list item from a Nintex Form.

If it is possible to kick off a workflow using the JavaScript button, how do I pass parameters to the function? 

Another thought is to use Runtime Functions and to use Form Variables to pass values, but I still don't see any Functions to create New List items from a Nintex Form.

Thoughts?

Hi,

If you're on-premise you can start workflows using script and the workflow.asmx web service, association data is passed in the following format:

<Data>

<your workflow variable name 1>hello</your workflow variable name 1>

<your workflow variable name 2>world</your workflow variable name 2>

</Data>

function startsiteworkflow(wfName, associationdata) {
     
    var webMethod = _spPageContextInfo.webAbsoluteUrl + '/_vti_bin/NintexWorkflow/Workflow.asmx';
    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>" +
                                "<StartSiteWorkflow xmlns=""http://nintex.com">" +
                                  "<workflowName>" + wfName + "</workflowName>" +
                                  "<associationData>" + associationdata + "</associationData>" +
                                "</StartSiteWorkflow>" +
                              "</soap:Body>" +
                            "</soap:Envelope>";

    $.ajax({
        type: "POST",
        url: webMethod,
        beforeSend: function (xhr) { xhr.setRequestHeader("SOAPAction", "http://nintex.com/StartSiteWorkflow"); },
        data: soap,
        contentType: "text/xml; charset=utf-8",
        dataType: "xml",
        success: function (data) {
           
        },
        error: function (e) {         
           
        }

    });
}

Jan


Reply