Blog

Custom Apex Action on Einstein Copilot in Salesforce

Do you know about Custom Apex Action on Einstein Copilot in Salesforce?

Standard Actions :

Salesforce has some built-in events, known as standard actions. The advantage of having standard actions by default is that your copilot will be ready to assist users with numerous common Salesforce operations as soon as you activate Einstein Copilot. In addition to these, you can also extend functionality by implementing a Custom Apex Action on Einstein Copilot in Salesforce. Below are the standard actions.

  • Summarize records
  • Draft or revise Sales Emails
  • Identify Object by Name
  • Query records/ Query record with Aggregate Data
  • Provide information from the Knowledge Base

Custom Actions :

You may also develop custom actions to offer your copilot extra abilities, allowing it to assist with duties unique to your organization. Access to a copilot custom action is determined by how it is constructed. The Custom actions that are supported are

  • Apex
  • Flow
  • Prompt Template

We can able to build the custom logic on Apex and Flows based on the business requirement.

Custom Apex Action on Einstein Copilot

Let’s consider a business scenario to send out the welcome email that needs to be sent manually by the admin to the employee to successfully get login access on Salesforce.

Step 1: Write an Invocable apex method which will send the Wishes Email to the Contact record which matches with input from the user.

Custom Apex Action on Einstein Copilot in Salesforce – Flow Configuration Example

Step 2: Setup → Einstein → Einstein Copilot Actions → New Copilot Actions

Diagram showing Custom Apex Action on Einstein Copilot in Salesforce

Step 3: Select Apex Action type with Invocable method name and provide the Copilot Action Label.

Benefits of using Custom Apex Action on Einstein Copilot in Salesforce

Step 4:

  • You should effectively provide the Copilot Action Instructions as the AI will identify the Action based on the instruction provided by the User.
  • As the Invocable method has a parameter to be passed, the custom action creation module will automatically detect it and show it here.
  • Select the Checkboxes per the need to relate with input and output variables.
User interface showing Einstein Copilot with Custom Apex Action in Salesforce

Send Wishes Email Custom Copilot Action

Code snippet for Custom Apex Action on Einstein Copilot in Salesforce
Custom Apex Action execution process in Einstein Copilot on Salesforce

Demo Images:

The AI Assistant will automatically identify the name of the contact if we have provided the instruction properly otherwise, it will ask for input.

Integration of Custom Apex Action with Einstein Copilot in Salesforce setup
Step-by-step guide for building Custom Apex Action on Einstein Copilot in Salesforce

Note:

  • Custom Einstein Copilot Actions need to be added to Copilot Builder to make it available for users.
  • Einstein Copilot should be Inactive to add the custom Copilot actions

We are Inno Valley Works, We are a passionate team of developers, best thinkers and consultants who can solve anything and everything.
With our highly engaging team, you can easily bring the vision to all your business ventures come true.
We have team, put your problem, get your solution


🎥 Check Out Our YouTube Channel

Explore helpful tutorials, product updates, and feature walkthroughs from the team at Innovalley Works.

👉 Visit Our Channel