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

Validate fields before starting workflow

Jump to solution

Hello Everybody,

I am using Nintex forms and Workflows in Office 365. I have created a Nintex form cotaining all fields. There are two requirements
1. It must be possible for user to save draft version of the list item without starting the workflow.

2. Before starting the workflow all fields must be filled and validated.

My solution is creating a form which contains two buttons, one for saving list item and the second one for starting the Workflow.

Before you click on the second button it must check all fields are filled and valdiated.
How you can start a Workflow by clicking on a custom button? Do I need to add valdiations inside the workflow or outside it and relying on JavaScirpt? what is the best solution?
Thanks and appreciate all kind of advice.

Reply
3 Replies
andrewg
Nintex Newbie

Re: Validate fields before starting workflow

Jump to solution

There are some onpremise solutions similar to this, but I built one that was much more simple and didn't require javascript in the buttons. The users seemed to like it as well.

Just add a checkbox at the end of the document near the submit button. Have a caption next to it "Submit as Final", or "Submit to workflow", or "Check here when all fields are final", anything really.

Then have the validation formulas check this check box. So a formula may be fn-If(CHK1, fn-IsNullOrEmpty(MyImportantString), false)

You are basically trying to make the field invalid if the check box is checked and it is empty.

So that is the user experience, but in the workflow, you can start on item created then immediately use a Conditional Branch and check if the check box is checked. If it is then continue with the workflow. If it is not, then Wait for Field Change in Current Item.

This may not work for your scenario, but it's an idea to think about

Reply
Not applicable

Re: Validate fields before starting workflow

Jump to solution

Thank you Andrew,


This is first time I am using Nintex workflows, I will try to achieve your solution. I would need some technical advice about how to make the workflow to wait for the checkbox. Does it mean the workflow checks in intervalls if the checkbox is checked? does it has any impact on the performance?

Reply
andrewg
Nintex Newbie

Re: Validate fields before starting workflow

Jump to solution

No problem, and welcome to the community. As you will learn, there is always more than one way to accomplish the same goal with Nintex. So you can start in one direction and with the beauty of the tool you can change it as you go and tweak the solution. If you didn't like a direction you were heading you can roll back to a former solution.

But if the workflow starts on item create and the checkbox isn't checked, and as I mentioned the workflow then Waits for Field Change on Current Item (this is an action in the designer), the workflow will keep checking if the field was changed. Its periodic, and isn't much overhead. But if you have thousands upon thousands of these workflows waiting at a given time then you may want to consider an alternate method.

Reply