Loading
Automate Your Business Processes
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Create Email Activity with Associations Action

          Create Email Activity with Associations Action

          This action creates activity and email message entity records from temporary email records and associates them with specified account, contact, lead, opportunity, and user records. To be used in the Activities: Match Email to Records flow. Requires that Sync Email as Salesforce Activity is enabled in Einstein Activity Capture.

          Required Editions

          Available in: Lightning Experience
          Available with Einstein Activity Capture Standard in Sales Cloud in Starter, Professional, and Enterprise Editions
          Available with Unlimited Edition and Einstein 1 Sales Edition
          Available with Einstein for Sales, which is included in Einstein 1 Sales Edition, and available for an extra cost in Enterprise and Unlimited Editions.
          Available with Sales Engagement in Sales Cloud, which is included in Performance and Unlimited Editions, and available for an extra cost in Professional and Enterprise Editions.
          Available with Revenue Intelligence, which is available for an extra cost in Enterprise and Unlimited Editions.

          For example, an email conversation occurs between sales reps and clients. Einstein Activity Capture stores the client email address automatically. Another action matches the email address to associated contact records and an opportunity record. Then, this action creates activity and email message entity records from temporary email records and associates them with specified account, contact, lead, opportunity, and user records.

          In Flow Builder, add an Action element to your flow. In the New Action window, search for Activities Match, and then select Create Email Activity with Associations.

          Set Input Values

          Use values from earlier in the flow to set the inputs for the action. The sum of records in contacts, leads, and users must be 50 or less per email message.

          Field Description
          Account Required. The account record to associate with the specified activity.
          Temporary Email ID Required. The ID of the temporary email record to be synced as standard activity and email message entity records.
          Contacts Required. The collection of contact records to associate with the specified activity.
          Leads Required. The collection of lead records to associate with the specified activity.
          Opportunity Required. The opportunity record to associate with the specified activity.
          Users Required. The collection of user records to associate with the specified activity.

          Error Conditions

          Error Condition Description
          Temporary Email ID isn’t of type EmailMessage

          Something's not right with the ID specified for the Temporary Email ID. Check it and try again.

          Error Code: INVALID_INPUT

          The list of matched contact, user, or lead records exceeds the limit of 250 entries

          Error Code: LIMIT_EXCEEDED

          Temporary Email ID is null or empty

          Specify a value for the Temporary Email ID.

          Error Code: REQUIRED_FIELD_MISSING

          Usage

          To use this action, you must enable Sync Email as Salesforce Activity. The action is designed mainly for use within the Activities: Match Email to Records flow. If a user manually associated an email message with a user, contact, lead, account, or opportunity record, then this action doesn’t overwrite that association.

          How It Works

          This action uses as input a list of users, contacts, and leads, and an account and opportunity. It saves information about these associated records to the EmailMessage record. The action uses the Temporary Email ID and contacts, users, and leads to update the CcIds, FromId, and ToIds fields on EmailMessage. It uses an account or opportunity record to update the RelatedToId field on the EmailMessage.

          When the action updates the CcIds, FromId, and ToIds fields on EmailMessage, the EmailMessageRelation record is updated automatically. Similarly, the AccountId and RelationId fields on the Task record are updated automatically.

          Limitations

          This action is limited to usage within a flow. It can't be invoked through other methods such as Apex, REST API, Copilot, Prompt Studio, or Einstein Bots. While actions can typically be invoked through various frameworks like InvocableActionService, this specific action is restricted solely to Flow.

          If the email message’s HTML body exceeds 131KB, then the text body is saved. If the text body exceeds 131,072 characters, then any characters after the limit are truncated.

          The limit of matched users, contacts, and leads is 50 total. If more than 50 matches are found, then the action prioritizes the user record matches first, then the contact and lead matches.

          If the activityId field is empty when debugging this action, use the Developer Console to query StagedEmail for a value.

           
          Loading
          Salesforce Help | Article