Use PDIs? Take our 5-minute survey to help shape the PDI roadmap.

How do I access "origemail" in Inbound email action flow?

Shahid4
Tera Contributor

I am trying to use Inbound email flow instead of Inbound email actions. To be honest I am really struggling with finding right information.

 

I need to use email.origemail in my flow but can't find it. For example, I tried: 

fd_data.trigger.inbound_email.origemail

 but no luck. I also tried to look into the headers, again no luck from the flow.

 

Any idea? Thanks

5 REPLIES 5

Hemanth M
Tera Sage

Hi @Shahid4 ,

 

You can use from address as below if it works in your case (Use if condition after inbond trigger to access email variables)

 

HemanthM1_0-1697217904054.png

 

HemanthM1_1-1697217970038.png

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025,2026

Thanks for the reply. Yes, I already checked that.

I have a scenario where the email.from may not be the same as origemail in which case I need to check if they are same or different. I don't understand why this is available in the inbound actions but not in the flow! 

bhargavi9919
Tera Contributor

Hi All,

i tried fd_data.trigger.inbound_email.origemail it is not working coming as undefined, any idea/solution.

 

Thanks in advance

Shruti
Giga Sage

Hi @Shahid4 

Use the below script to fetch original email from email body

var emailBody = fd_data.trigger.body_text;
var regex = /From:\s(.*)/; // Example regex to find the "From:" header
var match = emailBody.match(regex);
 
if (match && match[1]) {
    var originalSender = match[1].trim();
    var finalAddress = originalSender.match(/<([^>]+)>/);
     return finalAddress[1];
}