Skip to main content

I am trying to build a flow for Email-to-Case that would allow automated ownership and field changes based on the related email messages.

What I have in mind:

1. Email arrives to either one of these queues:

    • Broker_Emails_UK_Office (routing criteria: if related account`s party code is NOT ”LMEU”, go to this queue)
    • LMEU_Emails (routing criteria: if related account`s party code is”LMEU”, go to this queue)

2. Autoresponse email is sent

3. Team is taking ownership of cases manually from the respective queues

4. Response is sent by agent – Case status automatically changes to: “Response Sent” and ownership moved back to: In_Progress_ Broker_Emails_UK_Office OR In_Progress_ LMEU_Emails

5. When a response is received, the case status changes to: “To Respond” and agents can take ownership manually again

6. Once the case is resolved, either the agent closes the case or if there are no incoming or outgoing emails related to that case, change the status to “Closed”.

7. If a customer responds, change the case status to “To Respond”

 

This is the solution I tried to create, but no luck so far:

  1. Object: Email Message;  “A record is created” & “after the record is saved”
  2. I added as conditions the FromAddress OR ToAddress EQUALS the email-to-case email address ( Not sure if that`s a good idea….or how else could I filter for the relevant messages. I am a bit concerned that if an agent changes the From address, things may get missed. This should supress autoresponder though.
  3. Get records: To get related cases – Object: Case, Conditions met: Id EQUALs {!$Record.RelatedToId}; Only the first record, Automatically store all fields
  4. Decision: Incoming Emails for Different Offices
    1. Route: Outgoing Email - UK Office
      1.  $Record > Is Incoming EQUALS FALSE) AND ({!Get_Related_Cases.Account.Party_Code__c} NOT EQUAL “LMEU”)
      2. Assignment: {!Get_Related_Cases.OwnerId} ADD– queue`s id ( I realise that hard coding is bad, but with get records I didn`t know how to look up the custom metadata types`s record for 2 records that correspond to the 2 queues and not only have a specified or all items there. Do I do 2 separate get records?
    2. Route: Outgoing LMEU email
      1. ({!$Record.Incoming} EQUALS True) AND ({!Get_Related_Cases.Account.Party_Code__c} EQUALS LMEU)
      2. Assignment: {!Get_Related_Cases.OwnerId} ADD Queue`s id
    3. Decision: Close?
      1. ({!Get_Related_Cases.LastReferencedDate} GREATER THAN here I created a formula variable {!Notreferencedfor5days} ) .

 {!Notreferencedfor5days} = NOW()-5

                       4. Assignment: Close case: {!Get_Related_Cases.Status} EQUALS Closed

 

Testing:

The ownerships didn`t change as expected.

 

I hope someone can guide me in the right direction. Any help is appreciated!

Thank you!

 

@Salesforce Flow Automation 

1 件のコメント
0/9000