Setting up workflow for tracking first email response - Answers - Salesforce Trailblazer Community
Ask Search:
Scott RussoScott Russo 

Setting up workflow for tracking first email response

Good day all,

We are looking to track how long it takes from when a new case is received, to when the first email is sent to the customer, Excluding the auto-response email.
I saw previous posts about using workflow to create a timestamp on the case using a custom field.  This is perfect

My criteria would be to only update the time stamp field if the following are true.
The time stamp field is empty(NULL)
The email from field is not "noreply@companyname.com"

The trigger would set the time stamp field using Now() function.

My only problem is, I am not sure which object to relate this trigger.  At first I thought it was email, but I beleive this is only for incoming emails, and not outgoing.
I looked at relating to a case, but I do not see the criteria to trigger off of a 'send email event'
Which object should be selected?

--------------------------
Additional assistance, since I am not a Salesforce developer.
I believe I need another custom field to display the total time between the create date, and the time stamp.
What would the formula be for this field?

Thank you for your assistance
 

Scott

Best Answer chosen by Moderator (salesforce.com) 
Marco (werewolf) CasalainaMarco (werewolf) Casalaina
The Email Message object is the right object to target with your workflow -- it applies to both incoming and outgoing messages (incoming are where the Incoming field is True).

If this answer worked for you, please mark it as the best answer.  Thanks!

All Answers

Marco (werewolf) CasalainaMarco (werewolf) Casalaina
The Email Message object is the right object to target with your workflow -- it applies to both incoming and outgoing messages (incoming are where the Incoming field is True).

If this answer worked for you, please mark it as the best answer.  Thanks!
This was selected as the best answer
Scott RussoScott Russo
Thank you.  I realized I had the criteria set to not equal to Null, rather than equal to null.  I appreciate the reply.

Can you assist with the second part as well?

Additional assistance, since I am not a Salesforce developer.
I believe I need another custom field to display the total time between the create date, and the time stamp.
What would the formula be for this field?
Scott RussoScott Russo
I found a thread that fits perfectly.
https://success.salesforce.com/questionDetail?c=09a30000000D9y3&category=&qId=08730000000J7TzAAK&returnUrl=%2Fapex%2FideaList%3Fc%3D09a30000000D9y3&sort=popular

Thanks for quick reply Werewolf.  You rock!!!
Marco (werewolf) CasalainaMarco (werewolf) Casalaina
The formula for the second field would be

NOW()-Case.CreatedDate

I believe that will give it to you in fractional days (like 1.5 is a day and a half) so you may need to do some further math on it if you want hours.
Christian MeredithChristian Meredith
Hey this is exactly what I need to do.  Is there a way to step by step it out the 'how' to write this.  I need to be able to track the time between the email from Customer and then the time it took us to send our 1st response back.
Ravindra SfdcRavindra Sfdc
 Is there a way to step by step it out the 'how' to write this.  I need to be able to track the time between the email from Customer and then the time it took us to send our 1st response back.
Tushar AroraTushar Arora
First create a new Date time field called "FirstResponseDateTime" on Case object. This field will be used to store first email response date time on that Case. Make sure you give FLS to atleast system admin profile otherwise it won't be visible in process builder.

We can capture the time stamp of the first email response by using the "Is incoming" field on "Email Message" object. For this we need to create a process using process builder on "Email Message" object that runs on create and update operations.

We can use the logic that if
IsIncoming == False AND FirstResponseDateTime == null
then 
Set FirstResponseDateTime to current date time by using the formuala Now(). 

But this logic also works for auto-response email messages. 
So to prevent auto-response email messages stamping on FirstResponseDateTime field we need to use another field called "ReplyToEmailMessageId" on "Email Message" object. We can differentiate a normal outbound reply email and auto-response email by using this field. This field value is "null" for auto-response email message and is not null for a normal outbound reply email. 

So the logic to capture first response time stamp on the process on "Email Message" will be like below.

FirstResponseDateTime != null AND IsIncoming == False AND ReplyToEmailMessageId != null
Daniel GotliebDaniel Gotlieb
@Tushar .. I can't find "replytoemailmessageId" field in the process builder, any suggestions?