We have some wide ranging troubles with @contains not working when interrogating email sender and subject lines. Am interested (and would be very grateful) if anyone can spot the problems with these codes!
Example in the case of email sender:
@contains(triggerBody()?['From'], 'my.name@my.company.com')
This does not =true when the sender's email address contains my.name. The only way we have found to get a condition to fire correctly is using @equals which limits things obviously.
Also... when trying to trap some different types of event using a nested if statement in a switch case 'On' box the following also does not work...
@if(contains(triggerBody()?['Subject'],'Alarm'),'AlarmCase',
if(contains(triggerBody()?['Subject'],'Warning'),'WarningCase',
if(contains(triggerBody()?['Subject'],'Test'),'TestCase','DefaultCase')
))
If the email subject contains the words 'Test' or 'Warning' or 'Alarm' this collection of @contains do not fire. We always default to the Default case.
In short, it seems as if @contains simply doesn't work - which is unlikely, or the syntax is subtly wrong, or I'm missing a huge thing here.