is there any way to directly start a workflow from a form? I would like to use a Nintex-Form to populate a sharepoint-list. When the user clicks on a button of the form a nintex Workflow should be started - any hints on how to accomplish this?
Best answer by cju
There are two possibilities :
the easiest one is to use a button control which action is Save and Submit. In the Advanced settings of the button, you can connect it to a number column (which default value is 0) and set its value to 1. Then you can build a workflow that will be conditionnaly executed at the update of the item if the number column is equal to 1. In this workflow, you can then execute another workflow or directly populate the SharePoint list. This possibility is explained by Vadim Tabakman in this article : Nintex Forms - Save or Submit - Vadim Tabakman . The inconvenient of this method is that your form has to be saved and closed to start the workflow.
the second one is more complicated but the workflow will be executed as soon as the user clicks on the button in the form. This method consists in adding a button control which action is JavaScript. This button will execute a custom javascript function that will start a workflow using a web request. The web request will call the Nintex workflow web service which is described in this article : Start a Workflow using a Web Service
the easiest one is to use a button control which action is Save and Submit. In the Advanced settings of the button, you can connect it to a number column (which default value is 0) and set its value to 1. Then you can build a workflow that will be conditionnaly executed at the update of the item if the number column is equal to 1. In this workflow, you can then execute another workflow or directly populate the SharePoint list. This possibility is explained by Vadim Tabakman in this article : Nintex Forms - Save or Submit - Vadim Tabakman . The inconvenient of this method is that your form has to be saved and closed to start the workflow.
the second one is more complicated but the workflow will be executed as soon as the user clicks on the button in the form. This method consists in adding a button control which action is JavaScript. This button will execute a custom javascript function that will start a workflow using a web request. The web request will call the Nintex workflow web service which is described in this article : Start a Workflow using a Web Service
So to have the form just send an email to notify someone that the SharePoint list has a new entry, everything above has to be done? Sounds like a work-around to the most basic of form functions.
If you'd like a workflow to be executed each time an item is created then you can configure this directly in the workflow settings - no need to configure anything in the form. The first method that I explained above has to be done if you'd like a workflow to be executed when the user clicks on a specific button on the form: for example, if you have a Nintex Forms with two buttons "Save as draft" and "Send" and you only want that your workflow starts when the button "Send" is clicked.
The first solution is such a beautiful and easy way to start a workflow with a click on a button within NINTEX forms. Unfortunately this does not work with NINTEX on O365 (as there is no "conditional" start option):
At the beginning of the workflow, you can add a condition to check if your property has the correct value. If it has, you can add all your actions and if it's no case, just don't add any action so that there will be no action to execute. So the workflow will always start but no action will be executed and it will directly stop.
Tell me if it's not clear
Note that now you can also use the Save and continue button which is very nice for this kind of use case
Ah, ok, that is also quite easy. Thanks a lot. I just tried it, but unfortunately I need to be in edit mode while pressing the dedicated button (value doesn't change from 0 to 1). Isn't this also possible while I'm in view mode?
Have you tried to change the configuration in the Advanced section of the button settings: "Visible when in view mode" to "Yes" and "Enable when in view mode" to "Yes"?
The first solution works fine without any issue on list workflow, but it is not working on the reusable workflow template. The workflow gets triggered if I click button "save as draft" instead of "Send". Do I need to do anything different for reusable workflow ?
I don't often use reusable workflows, so I can't help you a lot with that but there shoudn't be something different to configure. Have you tried to remove the start condition so that the workflow always trigger when an item is created/modified and then check the value of the column which should have a different value depending on the clicked button?
I have got option 1 working OK, however after the workflow completes, if I edit the item and click 'Save' it re-triggers the workflow. Do you know of any way of stopping this?
Henning Eiben is absolutely right . When I have such a workflow, I have the habit to put following actions at the beginning of the workflow :
Run if : If my column connected to the save and submit button has the value "1" (or it can be another value), then
Update current list item to "reset" this column. In other words, set the connected column of the current list item to "0"
Commit pending changes
I add a "Run if" action because in specific cases, the same workflow can be started by clicking on a specific button on the form or it can be started by another workflow.
Just back regarding the unwanted workflow restarts - I had configured my form with the first step being a filter "Run if 'submitted' column =1". At the very end of the workflow I had Update current list item to "reset" this column to 0.
I'm just wondering if it's important to have the 'update current list item' at the beginning of the workflow also - just underneath the 'run if' filter?
Also is it important to have the 'commit pending changes'? step. (I've recently had an unwanted restart recently and also a form that failed to start).
If in the workflow you don't update the current item or only once, then the "Commit pending changes" action is not important and you can put the "Update current list item" action where you want in the workflow. Be careful if in the workflow you're updating permissions of the current item: it will update the item and if the "submitted" column hasn't been reset, the workflow will trigger again.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.