Hi,
I need to send mail if column ‘c’ contains ‘success’, if I use for each row, the mail is getting triggered as many times success is present. I need to send single mail if any of the cell contains ‘success’ on column ‘c’
Hi,
I need to send mail if column ‘c’ contains ‘success’, if I use for each row, the mail is getting triggered as many times success is present. I need to send single mail if any of the cell contains ‘success’ on column ‘c’
Should this be used inside a for each row?
Not required!
use Read Range and If condition and pass this syntax!
Cheers
Hi,
Can you try the following condition in If activity?
dt.AsEnumerable.Any(function(r) r("NameOfColumnC").toString.Contains("success"))
In this case, you don’t need to use for each row.
dt is output of Read Range activity and please change the column name to yours.
Regards,
It worked! Can I add and or condition with this (i.e., to add condition if it contains ‘error’ values also in column ‘c’ )
Yes. Hope the following helps you.
Check if it contains “success” or “error”.
dt.AsEnumerable.Any(function(r) r("NameOfColumnC").toString.Contains("success") OrElse r("NameOfColumnC").toString.Contains("error") )
In some condition, you can also use Regex.IsMatch method as the following.
dt.AsEnumerable.Any(function(r) System.Text.RegularExpressions.Regex.IsMatch( r("NameOfColumnC").toString,"success|error" ))
Regards,
how can I check an empty cell value instead of error
dt.AsEnumerable.Any(function(r) r(“NameOfColumnC”).toString.Contains(“success”) OrElse r(“NameOfColumnC”).toString.Contains(“error”) )
Hi,
how can I check an empty cell value instead of error
The following helps you.
dt.AsEnumerable.Any(function(r) r("NameOfColumnC").toString.Contains("success") OrElse String.IsNullOrEmpty(r("NameOfColumnC").toString))
If you have null reference error, you need to check if r(“NameOfColumnC”) is null as the following
dt.AsEnumerable.Any(function(r) r("NameOfColumnC") is Nothing OrElse r("NameOfColumnC").toString.Contains("success") OrElse String.IsNullOrEmpty(r("NameOfColumnC").toString))
Regards,
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.