Lightning Console Set Tab Label Dynamically

Salesforce console is one of the key areas for agents to boost service productivity.we will see how to set the console case tab label dynamically based on the case origin.we will append the case origin to the case number while setting the label.

Apex Class 

Service Class 

Lightning Component 

The following line will return the workspace API library reference

The following method of the workspace API will be used to set label.

Now add this component to the Lightning record page as shown below.


If the case is created form the web the case label is appended with the web and case number as shown below

If the case is created from the email, then case label will be changed to email – case number.