Solved

Start a Workflow from a Nintex Form

  • 29 January 2015
  • 22 replies
  • 730 views

Badge +7

Hi,

 

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?

icon

Best answer by cju 5 February 2015, 20:11

View original

22 replies

Userlevel 5
Badge +9

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

Hope it helps

Badge +7

Hi Caroline,

thx for your reply. I came to the same conclusion as your first solution - seemed to be the easiest way to achieve what I wanted.

Badge +3

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.

Userlevel 5
Badge +9

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.

Hope this helps

Badge +10

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):

Any suggestion how to solve this issue on O365?!

Cheers

mai-kel

Userlevel 5
Badge +9

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

Have a nice day,

Badge +10

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?

Cheers

mai-kel

Userlevel 5
Badge +9

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"?

Badge +10

Both settings were already set to "yes".

Userlevel 5
Badge +9

ok, then it's not possible in view mode... sorry

Badge +3

Hi Caroline,

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 ?

Any thoughts ??

Thanks

Jag

Userlevel 5
Badge +9

Hi Jag,

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?

Badge +4

Hi Caroline

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?

Thanks

Badge +7

Well, within the workflow you should reset the value of the column to "0" to prevent new starts of the workflow.

Userlevel 5
Badge +9

Hi Sean,

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.

Hope this helps

Badge +4

Thank you Henning and Caroline, that's an easy solution and it seems to work perfectly! Another little tip to add to my list!

Userlevel 5
Badge +9

Great ! I'm glad that we could help

Badge +4

Hi Caroline

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).

Thanks

Userlevel 5
Badge +9

Hi Sean,

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.

Hope this helps

Badge +4
The Vadim Tabokman article that you linked to does not exist anymore so this is not very helpful anymore.
Badge +4

I’m having this same issue.

Userlevel 5
Badge +13

I think this is the new link to Vadim’s blog post that was previously referenced: Nintex Forms – Save or Submit – Workflow Excellence

Reply