- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 08:38 AM - edited 04-08-2025 08:39 AM
The inbound action I’ve set up is meant to create a request when an email is received. However, the scenario involves a forwarded email — specifically, emails forwarded from abc@gmail.com to dev@service-now.com. I only want to create a request if the original sender is abc@gmail.com. How can I add a condition to check for the original sender's address? Also, should the Type be set to Forward in this case?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 08:49 AM
Hi @Vijay Kumar4,
In the email action 'Actions' tab you can use the following syntax to obtain both the senders email and the original senders email (from where it was forwarded from:
- email.origemail
- email.from
Below is a great article from @jonnyseymour who explains in more detail - Kudos jonny:
To help others (and for me to gain recognition for my efforts), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 10:20 AM
Hello @Vijay Kumar4
Did you add the condition in the "CONDITION" field directly as I said in my previous reply ?
Because it will not allow the inbound action to proceed if sender is not this.
As for your "email.origemail" its because it will returns only when its included in email headers.
""Contains the address of the email sender as listed in the email Headers field"".
Refer this document by servicenow - https://www.servicenow.com/docs/bundle/yokohama-platform-administration/page/administer/notification...
And your header wouldn't contains it that's why it returns same in both original and sender.
I hope this answers your queries.
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 08:49 AM
Hi @Vijay Kumar4,
In the email action 'Actions' tab you can use the following syntax to obtain both the senders email and the original senders email (from where it was forwarded from:
- email.origemail
- email.from
Below is a great article from @jonnyseymour who explains in more detail - Kudos jonny:
To help others (and for me to gain recognition for my efforts), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 10:07 AM - edited 04-08-2025 10:14 AM
// Convert everything to lowercase for reliable comparison
var sender = email.from.toLowerCase();
var orgSender = email.origemail.toLowerCase();
var body = email.body_text.toLowerCase(); // Prefer body_text over body to avoid HTML formatting
// Check if the sender is abc@gmail.com or if the original message contains 'From: abc@gmail.com'
if (sender == 'abc@gmail.com ') {
current.requested_for = gs.getUserID();
current.short_description = email.subject;
current.description = 'Original Email: '+orgSender+'\n'+'Sender: '+sender;
current.contact_type = "email";
current.insert();
}
@Robbie Thanks for the response. I’m facing another issue - even when I check the sender in the Action script, a request is still being created if an email is sent from a different address. However, the assigned values are not being populated. How can I prevent the request from being created entirely if the sender condition is not met?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 09:22 AM
Hello @Vijay Kumar4
Yes, set it to Forwarded.
And in the conditions field just add below 👇 code -
email.from == abc@gmail.com
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 10:10 AM - edited 04-08-2025 10:15 AM
@Shivalika Thanks for the response. I’m facing another issue - even when I check the sender in the Action script, a request is still being created if an email is sent from a different address. However, the assigned values are not being populated. How can I prevent the request from being created entirely if the sender condition is not met?
// Convert everything to lowercase for reliable comparison
var sender = email.from.toLowerCase();
var orgSender = email.origemail.toLowerCase();
var body = email.body_text.toLowerCase(); // Prefer body_text over body to avoid HTML formatting
// Check if the sender is abc@gmail.com or if the original message contains 'From: abc@gmail.com'
if (sender == 'abc@gmail.com ') {
current.requested_for = gs.getUserID();
current.short_description = email.subject;
current.description = 'Original Email: '+orgSender+'\n'+'Sender: '+sender;
current.contact_type = "email";
current.insert();
}