Loading

Create a task from the 'EmailMessage' object with Process Builder

Publiceringsdatum: Jul 14, 2026
Beskrivning

This article explains how to create a Salesforce Process Builder process that fires on EmailMessage record creation and automatically generates a Task.

Note: Process Builder is being retired — new automations should be built in Salesforce Flow. The EmailMessage object stores email addresses as plain string fields (ToAddress, CcAddress, FromAddress) rather than as lookup relationship fields, which is why it is not possible to automatically link the generated Task to the sending or receiving Contact, Lead, or User record.

Lösning

Steps to create the Process Builder process

1. Go to Setup.
2. Enter Process Builder in the Quick Find box.
3. In Process Builder, click New.
4. Input Process Name and let API Name auto-populate.
5. Optionally, input Description.
6. Select “A record changes” for the process starts when.
7. Click Save.
8. Click Add Object.
9. On the Object field, type in “Email Message”
10. Click Save.
12. Click Add Criteria.
13. Input the necessary details i.e. Criteria Name, Criteria for Executing Actions, and Conditions.
14. After it is done, click Save.
15. Click Add Action under Immediate Actions.
16. Select Create a Record.
17. Input Action Name.
18. Type in “Task” for the Record Type.
19. Input the necessary field values.
20. After it is done, click Save.
21. Verify the details and then click Activate.

Limitation: Relating Tasks to Email Senders and Recipients:

Because the email addresses in the EmailMessage object are stored as string fields (ToAddress, CcAddress, FromAddress), it is not possible to automatically resolve these to Salesforce Contact, Lead, or User record IDs within Process Builder. As a result, the WhoId (Contact/Lead relationship) on the created Task cannot be set to the actual sender or recipient.


Alternative: Use Salesforce Flow Instead:

  • Use Salesforce Flow (Record-Triggered Flow on EmailMessage, After Save) with a Get Records element to look up the Contact or Lead by email address, then create the Task with the correct WhoId.

    Note: Process Builder is being retired — new automations should be built in Salesforce Flow.
Knowledge-artikelnummer

000383310

 
Laddar
Salesforce Help | Article