Hi @Simran2,
I think in GetOutlookMailMessage, put condition “@SQL=(urn:schemas:httpmail:subject LIKE ‘%Invoice%’)”.
This will fetch all unread mails where subject line contains Invoice keyword and then in if condition you can check if mailMessage count>0, proceed with steps else throw exception.
This way we can avoid loop as well.
Thanks & Regards,
Disha Jain