Solved

How do I create a workflow that is triggered on new/updated item, but does not repeatedly send out tasks for ones that are completed?

  • 24 April 2023
  • 7 replies
  • 290 views

Badge +2

Hello,

I’ve created a workflow in NWC where the start event is new or updated item, then there are 3 parallel paths/branches where if a username is input into a “reviewer” type field, then it assigns a task (and sends email) to the person listed.

 

The three fields on the form that trigger the paths of the workflow are:

  • If ‘Liaison Reviewer’ is filled, then send an email to ‘Liaison Reviewer’ email address
  • If ‘Additional Liaison Reviewer’ is filled, then send an email to ‘Additional Liaison Reviewer’ email address
  • If ‘M&M Reviewer’ is filled, then send an email to ‘M&M Reviewer’ email address

The issue I’m having is that if the person filling out the form initially puts someone in the Liaison Reviewer field, then an email gets sent to that person for their task form. If the form is then updated later on and someone is put into the Additional Liaison Reviewer field, then an email gets sent to that person as well as the first person in the Liaison Reviewer field even though that first task is already completed. 

Is there a good way to stop the workflow from being triggered if a task form has already been sent out? Or a better way to configure my workflow?

Form fields:

Workflow:

 

icon

Best answer by Garrett 26 April 2023, 19:17

View original

7 replies

Userlevel 6
Badge +16

Hi @JAhmadvand 

 

Add “Flag” fields to signal not-to-run.

 

The three fields on the form that trigger the paths of the workflow are:

  • If ‘Liaison Reviewer’ is filled, then send an email to ‘Liaison Reviewer’ email address.
    Set ‘Liaison Reviewer Sent-Flag’ to Yes
  • If ‘Liaison Reviewer’ is filled and ‘Liaison Reviewer Sent-Flag’ is Yes → STOP 
  • If ‘Additional Liaison Reviewer’ is filled, then send an email to ‘Additional Liaison Reviewer’ email address. Set ‘Additional Liaison Reviewer Sent-Flag’ to YES
  • If ‘Additional Liaison Reviewer’ is filled and ‘Additional Liaison Reviewer Sent-Flag’ is Yes → STOP
  • If ‘M&M Reviewer’ is filled, then send an email to ‘M&M Reviewer’ email address
    Set ‘M&M Reviewer Sent-Flag’ to YES
  • If ‘M&M Reviewer’ is filled and ‘M&M Reviewer Sent-Flag’ is Yes → STOP

 

Have you considered using Start Event Conditions?

 

Badge +2

@Garrett Thank you for your response! I think this could work, but I’m stuck. I’ve created the flag fields, but wondering how you would go about updating them to “Yes” - what action in NWC could I use to do this? 

Thanks in advance,

Justine

Userlevel 6
Badge +16

Hi @JAhmadvand 

Great, you have created the flag fields in SP Online.

Use the “Set A Variable Value” if you want the flag variable and set it value to YES (This is optional)

Use the “Update List Items” to set the values . You can select the Flag Column and enter the value direction or use a variable value 

 

Your workflow has the structure already. Its the red box. Update the value of the flags using your existing structure.

 

 

Userlevel 5
Badge +21

Hi @JAhmadvand 
Did Garrett’s responses solve your question? 

Badge +2

Hi @MillaZ,

Sorry for the delayed response. I was just able to get back into this this week. Yes, Garrett’s response did work for what I needed although I had to change up some things. 

I updated my workflow for each path to update the status for each task item if the conditions were met. Here’s an example for the first path:

Branch 1:

  • Run if true: Liaison Reviewer is not empty AND Liaison Reviewer Status is empty
  • Update Liaison Status in list: Updates field “LiaisonReviewerStatus” to Pending
  • Assign a task to Liaison Reviewer: sends email to whoever is listed in that field
  • Set a variable: this is for the comments from the task form
  • Update Liaison Response/Status in list: comments from task form are updated in list and field “LiaisonReviewerStatus” is updated to Completed

Branch 2: 

  • Run if true: MMLiaison is not empty AND MM Reviewer Status is empty
  • Remaining items are basically the same as Branch 1

I’ve tested and this seems to work pretty well overall; however, I’m running into one problem. If the status is Pending from the first branch for Liaison Reviewer, but someone goes in to edit the form and set off the task for M&M Reviewer, this branch doesn’t kick off until the task form for the first Liaison Reviewer is completed. So, it’s almost like Branch 2 won’t start until Branch 1 is completed. Is there some way to have the second branch kick off regardless of the first Branch? It seems from the conditions I have setup for Branch 2 that it wouldn’t be contingent at all on Branch 1, but I’m obviously missing something.

Any ideas @Garrett?

Ps. Thank you so much for the help - I wouldn’t have gotten this far without it!

Userlevel 6
Badge +16

Hi @JAhmadvand 

What you want is to run multiple parallel workflow instances on the same List Item, right?
The most I done is to re-run workflows but only after the previous workflow has completed on an item.

However, Nintex does not support running multiple workflow on the same list item - from what you may have encountered, its possibly true that NAC/NWC platform may not support it too,

 

 

Userlevel 5
Badge +13

@Garrett it is possible to run multiple NAC workflows on the same list at the same time, even the same workflow however you will run into issues of control and conflict so it is not advised. 
 

@JAhmadvand What you are trying to build is a concept I like to call a logic state engine, what you need to do is wrap the tasks in a state machine and loop the state machine based on logic you apply. 
 

the best way to actually handle this would be to reduce the workflow to a single task and using a state machine to loop back to that task (changing the task details etc) to the new assignee. There is a blog in my profile

 that explains a similar concept for 365 workflows to help with throttling. 

 

it would allow you in this case to conditionally assign tasks based on logic stored inside a sharepoint list, it can then even be used to expand and make a workflow assign 1 or even 1000 tasks with only one task action.

please check out my blog post to get the concept, it is written for 365 but the same logic works in NAC. 
 

hope this helps 

 

Reply