I'm trying to send email notifications when someone enters a Case Comment. Since there doesn't appear to be a way to do this via configuration, I have create a Visual Flow that will create a Case Comment Notification record, which will in turn send an email. That works just fine.

However, I need to include the Case Email Thread so that when the requester replies to the notification, it is tracked back to the case. But, when I try to find this field on the Case object in Visual Flow, it doesn't appear.

How can I obtain the Email Thread in Visual Flow so that I can include it in my email?

1 Answer 1


While I realize this is not ideal or even recommended, one can use this formula from Salesforce ...

"ref:_" & LEFT($Organization.Id,5) & SUBSTITUTE(RIGHT($Organization.Id,11), "0", "" )& "._" & LEFT(Id,5) & SUBSTITUTE(Left(RIGHT(Id,10), 5), "0", "") & RIGHT(Id,5) & ":ref"

... or this if the first formula doesn't work:

"ref:_" & LEFT($Organization.Id,5) & SUBSTITUTE(RIGHT($Organization.Id,10), "0", "" )& "._" & LEFT(Id,5) & SUBSTITUTE(Left(RIGHT(Id,10), 5), "0", "") & RIGHT(Id,5) & ":ref"

Source: https://success.salesforce.com/ideaView?id=087300000006trk

I used it and it worked fine, but there's no guarantee it will continue to work in the future.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .