I'm working with a camera project and cameras sends mail when someone is in the detection Area. The subject looks like this “SBKs AcuSense NVR: intrusion On Channel D1”.
If have written some code that extracts the Channel number, in this case D1.
substring(triggerOutputs()?['body/subject'], 31, 2) and it works
But now if would like to add code so that D1 is House, D2 Boat Yard….
This works but when I add more if’s (instead of 'Unknown') it does not work
if(
equals(toUpper(substring(triggerOutputs()?['body/subject'], 31, 2)), 'D1'),
'House',
'Unknown'
)
I have asked CoPilot but no help there.