cancel
Showing results for 
Search instead for 
Did you mean: 
ieatorange98
Nintex Newbie

How to use Run If

Jump to solution

Hi guys, I'm doing a reminder workflow. I need to count the values in my DaysLeft column. I queried the list column DaysLeft and stored it in a variable which is HowManyDaysLeft. I want the workflow to send an email if the number in the DaysLeft column is from 3 to 0.  I managed to configure the Run if, if its equals a certain number it will send. But I seem to have trouble sending numbers from a range. I tried using OR but it still doesn't send the email even tho there are 3 and -2 on that column.  Please take a look at my configuration thank you. This is a site workflow btw.

My Query Configuration

My execute query list runs properly

My Run if configuration

Labels: (1)
0 Kudos
Reply
12 Replies
Automation Master
Automation Master

Re: How to use Run If

Jump to solution

what's datatype of HowManyDaysLeft variable? text or number?

if so, then it holds just one, first reutned value (6).

since your query returns multiple items, you have to store result set into a collection-type variable.

then you have to set up a for each loop and iterate over the collection to evaluate every single element/value within the collection.

Reply
Automation Master
Automation Master

Re: How to use Run If

Jump to solution

Hi there - 

Based on your Run If config, it looks like it should work.. but I do have a suggestion.

What about have it set "Where:..."

HowManyDaysLeft is GREATER THAN OR EQUAL TO 0

AND


HowManyDaysLeft is LESS THAN OR EQUAL TO 3

If you wanted to capture all the -2 etc days as well you'd just use the second one and not the first. 

However, can I make another suggestion to save you an entire workflow action?

In your Query List... 

Use your "Filter" capability to look at DaysLeft and only return those items with less than 3 in there. Then you can totally bypass this RunIf.  (Unless of course you're acting on all items you've brought back and just have a specific extra action / email for the ones with 3 or less days left.)

Let me know if you need any clarification.

Cheers,

rhia


E: Marian is totally right about needing to do a "for each" for the collection. However, if you use my second suggestion ("In your Query List...") you can bypass that as well until you send the emails.

Reply
ieatorange98
Nintex Newbie

Re: How to use Run If

Jump to solution

Hi I created a collection variable DaysLeftCollect and the DaysLeftItem which is a single text line variable.

I used the Query List function to query the column and then store the data in to the DaysLeftCollec Collection variable

My configuration for the For each loop

This is how my Run If config looks like

This is my overall view, is this how it should look like?

0 Kudos
Reply
ieatorange98
Nintex Newbie

Re: How to use Run If

Jump to solution

Hi I can't seem to find the option "Less than" or "Greater than".

0 Kudos
Reply
Automation Master
Automation Master

Re: How to use Run If

Jump to solution

yes, that's better approach.

but you have to place run if into for each loop - you have top make check for each and every collection element. as well, outside of for each loop value of variable DaysLeftItem is not valid.

next, I would defined DaysLeftItem  as numeric varible, then in run if action you will be able to compare with 'less then' or 'greater then' operators.

Reply
ieatorange98
Nintex Newbie

Re: How to use Run If

Jump to solution

Ah I see, so I just placed the Run If into for each loop. Is this correct? I also changed the DaysLeftItem to a numeric variable as well and managed to find the greater than options.

0 Kudos
Reply
Automation Master
Automation Master

Re: How to use Run If

Jump to solution

yes, this should be correct.

what's the outcome, do you already get notifications?

0 Kudos
Reply
ieatorange98
Nintex Newbie

Re: How to use Run If

Jump to solution

Hi, I'll let you know tomorrow, I don't have access to my laptop now. Thank you so much.

0 Kudos
Reply
ieatorange98
Nintex Newbie

Re: How to use Run If

Jump to solution

Yes, it works great thank you!

Reply