Workflow - And condition with null value

I would like to filter email by:

  1. Subject
  2. Sender
  3. mailBody

I have a datatable that stored above criteria, each row represent 1 type of mail.
User can choose to store all criteria for 1 type of mail, or they can enter either one/two criteria for a type of mail. The 3 conditions will be linked up by “And” condition.

e.g. Subject | Sender | MailBody

  1. ABC company | | Invoice
  2. CD Company | NULL | NULL

For 1, if uipath checked that all 3 criteria matches, then it will assign the 1st mail as ABC company
For 2, since Sender and Body are Null, so uipath will only check Subject field, if subject contains CD Company, then it will assign it as CD company.

My questions is, how should i construct the workflow so that the RPA will ignore Null value criteria, only select those criteria which is not Null, and use “And” condition to assign the mail?

I can only think of creating several nested if condition, to cater NULL and not NULL case with all 3 criteria matches, or either 2, or only 1, but the workflow will be clumsy and difficult to maintain

Hi @Haha

Datatable.Select("[Subject<>’’ and [Sender]=‘NULL’ and [Mailbody]='NULL '"). copy todatatable ()


I think the problem is, if sender criteria and mailbody criteria are null, then my logic will only need “subject match keyword”.
If only mailbody criteria is null, then my logic will be “subject match datatable.keyword” and " sender match datatable sender keyword"

Therefore it seems that I need to have 7 seperated cases?
Some case will only have 1 “match logic”, some will have 2, some will have 3.