Hi,
I have 2 emails having subject
Wires - date
Wires _affiliate - date
the spaces between may vary
i need to perform 2 different set of actions for both email subject by using else if activity
but how do i differentiate the emails?
else if : item.subject.startswith(“Wires”) - by using this both emails got read in same sequence
else if : item.subject.contains(“Affilate”)
if : no emails received today
Can anyone please help
Ajay_Mishra
(Ajay Mahendra Mishra)
April 3, 2024, 11:12am
2
Hey @shilpashree.mohanty ,
Try this condition in If Activity:
Else IF → Item.Subject.ToLower.Contains(“wires”) Andalso Item.Subject.ToLower.Contains(“affiliate”)
→ “All the activities related to Affiliate”
Else IF → Item.Subject.ToLower.Contains(“wires”) Andalso Not Item.Subject.ToLower.Contains(“affiliate”)
→ “All the activities related to Without Affiliate”
Else → No Mail Found
Cheers!
@shilpashree.mohanty ,
You should be using Else If this way:
Sample code:
MailCompare.xaml (12.7 KB)
Thanks,
Ashok
hello @Ajay_Mishra
as mentioned i need to use else if activity as i have 3 conditions
while using Item.Subject.ToLower.Contains(“wires”) Andalso not(Item.Subject.ToLower.Contains(“affiliate”)) and also item.attachment.any
its coming false so its not getting inside this sequence
used the same, but its not getting into the sequence & the conditions are inside for each loop
Ajay_Mishra
(Ajay Mahendra Mishra)
April 3, 2024, 11:25am
6
Hey @shilpashree.mohanty I have edited my solution please check!
Cheers!
@shilpashree.mohanty ,
You should be combining subject checking conditions into one () and attachment check outside as it is.
used but its coming as false
Ajay_Mishra
(Ajay Mahendra Mishra)
April 3, 2024, 11:40am
10
@shilpashree.mohanty Just Debug it!
I think 1st Iteration will be false, afterwards it will be true for another mail!
but i had both emails
it did for 1, for other it came out of loop
i want as both conditions satisfy, both conditions should work
@shilpashree.mohanty ,
Use this solution:
Sample code:
MailCompare.xaml (17.1 KB)
Output:
Thanks,
Ashok
Ajay_Mishra
(Ajay Mahendra Mishra)
April 3, 2024, 12:04pm
13
@shilpashree.mohanty Can you specify For which one it worked?
(check affiliate spelling correctly!)
Regards,
Ajay Mishra
is it possible for you to copy paste the conditions
my organization doesnt allow to download software and hence unable to open xamls
@shilpashree.mohanty ,
Here you go
(strMailSubject.ToLower.StartsWith("wires") And strMailSubject.ToLower.Contains("affiliate")) and item.Attachments.Count > 0
(strMailSubject.ToLower.StartsWith("wires") And Not strMailSubject.ToLower.Contains("affiliate")) and item.Attachments.Count > 0
Ajay_Mishra
(Ajay Mahendra Mishra)
April 3, 2024, 1:13pm
16
@shilpashree.mohanty Can you provide us exact subject line?
Used this way, still not getting into the first block while i have both emails in mail box
@shilpashree.mohanty ,
I hope there are attachments.
Ajay_Mishra
(Ajay Mahendra Mishra)
April 3, 2024, 1:24pm
20
Hey @shilpashree.mohanty Just switch the conditions,
Firstly put item.Subject.Contains(“Afiliate”) and item.Attachments.Any
and put related activities in this block
then in 2nd Else If put 1st Condition
Hope this will resolve your issue!