How to stop an action in the workflow under certain conditions


Badge +4

Hi guys I am currently doing expanding my workflow. It sends reminders if a due date is approaching, stating how many days are left. Depending on 3 conditions,

Send emails when the column daysleft is 7,

daysleft is 3 to 0

daysleft is 0 or less.

This is my workflow. How it works is it query the list column and then, stores the results in a collection variable, then I use the for each loop to store the results in the collection into a variable. The set condition is to check whether the variable is = 7 days. If yes send the 7 days email. If no, send if variable is 3 to 0, the other is to send if >0 days. 

It works perfectly, however now I want the email notifications to not be sent  if the column, Issue Status is changed to Closed or Open. It will send if its in Progress. I think that I have to use Query List to obtain the text and store it in a collection variable, then use each loop, but I don't know how to do it.


13 replies

Userlevel 2
Badge +11

Hi John Lim,

You're indeed on the right track. Indeed you need to include the Status field in your query and assign it to a 2nd collection variable. In the loop you can specify a number wf variable to hold the index, which you can use to get the Status for the current due date. In the Foreach loop put your emailing logic into a Run-if Status != Closed (or whatever criteria you require).

2 observations:

  1. At the start you mention "....daysleft is 0 or less....", however then you change to "...the other is to send if >0 days...' (also reflected in the run-if in the right parallel branch).
  2. If my 1st observation is correct and the 3rd email is indeed to be sent when daysleft is 0 or less days then using a parallel action for determining the 2 last emailing moments does not make sence. Just put both Run-if behind each other, as I don't think they will ever be executed together.

Best regards,

Jean-Pierre

Badge +4

Thanks, for your observations, oh sorry I put the title of the Run if wrongly, but the function is correct. The configuration for that is Run If  Variable< 0

These are my variables, I want to know if I can store my 2nd collec variable into a single line text variable, will it be ok?

This is my updated workflow, is this correct?

Sorry for the messy crop, my screen has a really small resolution.

Userlevel 5
Badge +14

extend filter conditions in your initial query list action so that it returns only match items where Status == 'In progress'

you need not then change rest of the logic anyhow (no special checks for item status)

Userlevel 2
Badge +11

Hi John,

This is not what I had in mind. The Foreach allows you to store the Index of the current item in DaysLeftCollec and store it in a workflow variable, for example varIndex. Which you can use in a "Collection operation" action to Get the status at varIndex in the IssueStatusCollec and store its result in a single line of text variable.IssueStatusItem.

See below example (actions are not configured, hence the warning sign in them):

Badge +4

Hi under the filter what option should I change to? Thanks!

Userlevel 2
Badge +11

Hi John,

Actually Marian's makes indeed more sense and would be the most simple one to implement; mine would be a decent alternative wink.png. The Query list has a Filter section, so you don't need a separate Filter action.....

Badge +4

Hi I don’t mind that photo, I realised its in the query list. But how do I filter it from there, I can’t seem to find any options. 

Userlevel 5
Badge +14

no, I don't mean 'Filter' action, I mean filter conditions within Query list action.

add one another condition to the existing ones, like 'AND Status equals InProgress'

216475_pastedImage_1.png

Badge +4

Ahh I see, thank you so much.  I will get back to u tmr, I’m away from my computer right now . 

Badge +4

Hi Marian, it works thank you so much happy.png. I changed the workflow to a list as I want to put the item properties inside: description.

Badge +4

Hi Marian but when I changed the daysleft for one item, it shows another another message? I changed the days left to 1 to,so it should show this message only

but It also shows this as well which is only suppose to send when the daysleft is >0

This is my message description for >0 days

for 3 to 1 days

How can I fix this?

Badge +4

EDIT: I think I know why its wrong, its because this workflow stores all the due dates and scans it and makes decision based of all of them. I want them to be singled out individually instead of using all the collection. Can you help me with it?

Badge +4

Hi I  posted a new question here, https://community.nintex.com/message/81021-re-help-with-reminder-workflow?commentID=81021#comment-81021.

Reply