Does anyone know a way to start a Nintex Workflow from Javascript and send in a String Parameter?

  • 26 January 2017
  • 8 replies
  • 8 views

Badge +9

I have a JavaScript Routine from a Site Page that builds some metrics for a List and displays a d3 Visualization of those metrics. Part of the process requires building a table of values. I'd like to be able to send a string of table values to a Nintex Workflow and Update a Summary List.  If I can get this to work through a string parameter, I can parse the string within the workflow and update the list. This would be easier for me than to resort to Client-Side Code.

This is what my same d3 visualization looks like:

197934_pastedImage_1.png


8 replies

Userlevel 5
Badge +14

see Vadim's site, he already described a possible solution - Nintex Forms - Starting a Workflow and Waiting - Vadim Tabakman 

reg. of passing through string data, you will need to configure a variable in workflow and set it to 'show on start form'. in js you will then put the string data into associationData element.

Badge +9

Not exactly what I'm looking for. I call a Site Page from Quick Launch. It executes some code to produce my d3 visualization by processing the data on a list. Next I would like to submit a string of data to a Site Workflow. The string would be an input parameter.

thanks,

Stephan

Userlevel 5
Badge +14

hm, then I'm not sure what's exactly your requirement...

as far as I understood, you do not want to make a web service call, right?

do you want to hand over string data to a field on default start form? I'm not aware of a way how could this be achieved.

do you want to hand over string data to a field on customized start form? that's theoretically possible through URL key and GetQueryString in form. but I would be careful with that since if you will collect bigger dataset you might hit max URL length limit.

these both mean that you show workflow start form to the user and expect (rely on) him to confirm start.

I would see web service call as a most reliable and from user point of transparent solution.

Badge +9

Yes I would like to pass a Query String from Javascript and Start a Workflow. I am not using Nintex Forms. All code comes from a Site Page.

thanks,

Stephan

Userlevel 5
Badge +14

so to add your data to URL you need:

WorkflowStartFormURL&TableValues=[YourURIEncodedTableValues]

and to read-in it in form set text control default value to formula:

GetQueryString('TableValues')

Badge +9

Looks promising.

I should be able to take a Simple Workflow and have a text parameter. I can get the URL bto a site workflow but I don't want to be ask to start the workflow.

 I'll do some testing.

Badge +9

How would I get the URL for the Site Workflow. 

On Workflow Settings in the Site Workflow, if I change the "Form Type" to "Custom" and then delete the text from "Start Page" the workflow will start without the StartUp Screen. How do I get that URL?

Userlevel 5
Badge +14

easiest way: navigate to workflow start form (ie. like when you are going to start it manually) on your own and copy it from browser's address bar happy.png

if you change form type to custom, start page field gives you link to your workflow start form too, but relative to site URL. you can copy it from there as well.

but for your case do not change form type to custom, keep it default.

on form settings dialog ribbon you should see 'Edit task form' icon - use it define your custom form. that should provide you possibility to edit start form in InfoPath (or whatever form solution you use)

but I only right now realized (sorry for that),  you mentioned you do not use nintex forms. GetQueryString is nintex' function, so you will not have it available (I'm not sure whether InfoPath or your forms solution provides anything like that).

so you will probably need to parse URL out and populate a form control/variable on your own.

hm, it's getting more and more complicated.

if I were you would really stick to web service call. If you were able to do some complex analyzes and visualizations over list data, one web service call would be a  playgame for you  happy.png

Reply