top of page

Retrieve the Case Thread Id

Writer's picture: Sean FieldingSean Fielding

Do a quick Google search and you will quickly discover a number of formulas claiming to accurately generate a valid Salesforce Email-to-Case Thread Id. Unfortunately, the majority of these formulas are wrong (or at least make some incorrect assumption). The reality is that the Thread Id and and does change instance to instance. The only reliable method for retrieving a thread Id is to pull it from the email template logic itself. I.e. {!Case.Thread_id}.

Good news! This logic is available in a convenient apex action.

Via Flow

Introducing the Email-to-Flow Retrieve Salesforce Thread Id function. Simple pass in your case id(s) and return you thread id(s).

Note: One you Opt In to Disable REF ID and Transition to New Email Threading Behavior, the apex action will always return ‘’.  This apex action should be used for transitional purposes only (as discussed in New Threading Behavior; Why Plan? (Part 1)).

Via Apex

//Initialize the apex action

List <emailtoflow.retrieveSalesforceCaseThreadId.parameter> params = new List <retrieveSalesforceCaseThreadId.parameter>();

//retrieve the case record which require a thread id populated

for(Case c :

Comments


bottom of page