- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2020 11:09 AM
Hi,
what is the syntax for if I want to check if the string DOES NOT CONTAIN in indexOf(). I am writting inbound actions so want to trigger only if it does not contain certain string.
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2020 11:11 AM
I did something like below to ignore a inbound action based on who is it from
email.from.toLowerCase().indexOf('XXXX@gmail.com') == -1
so on inbound action on condition field add something like that make sure to change field.
if you want to check subject line than use like
email.subject.toLowerCase().indexOf('XXXX') == -1

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2020 11:11 AM
I did something like below to ignore a inbound action based on who is it from
email.from.toLowerCase().indexOf('XXXX@gmail.com') == -1
so on inbound action on condition field add something like that make sure to change field.
if you want to check subject line than use like
email.subject.toLowerCase().indexOf('XXXX') == -1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2020 11:28 AM
Hi,
indexOf() method in javascript returns -1 if the string does not contain the string we are looking for otherwise the offset(which is greater than -1).
Syntax:
string.indexOf("lookup String"); // if -1 then not present, otherwise present
Check: JavaScript indexOf() method

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2020 11:49 AM
Hi,
If you want to check for subject, check like this
email.subject.indexOf("your_string")==-1