Skip to content

How to Automatically Create Salesforce Leads for New Emails

  • by

In this section, we will look at how you can integrate Gmail with Salesforce and automatically create Salesforce leads upon receiving emails on Gmail using Email Parser.
This automation requires a one-time setup, for which we will use Pabbly Connect.
We will first link Gmail with Pabbly Connect using Email Parser to capture the emails, then link Pabbly Connect with Salesforce and create leads using the captured emails.

Steps to Automatically Create Salesforce Leads for New Emails

1. Sign In / Sign Up to Pabbly Connect and Create a Workflow
2. Setup Email Parser by Pabbly as the Trigger App to Capture Emails
3. Add Text Formatter to the Workflow
4. Setup Salesforce as the Action App to Create Lead

Step 1:- Sign In / Sign Up to Pabbly Connect and Create a Workflow

A. Sign In / Sign Up

To begin this process, visit Pabbly Connect and create your account by clicking on the ‘Sign Up Free’ button. You can also click on Sign In if you already have an account.

Click on the Pabbly Connect ‘Access Now’ button

B. Create Workflow

To create a new workflow, click the ‘Create Workflow’ button.

Name your workflow, and click on ‘Create’.

Step 2:- Setup Email Parser by Pabbly as the Trigger App to Capture Emails

We will now look at the steps through which we will establish a link between Gmail and Pabbly Connect. This will help us to fetch the emails.

A. Trigger App

Trigger allows us to choose the application that will receive the data for Pabbly Connect. In our case, it would be Email Parser by Pabbly.

Choose ‘Email Parser by Pabbly’ as the Trigger App and copy the Email – this Email Address will be used to fetch the emails from your Gmail account.

B. Connect Gmail Account

Login to your Gmail account, and click on ‘Settings’ > ‘See all settings’.

Select ‘Forwarding and POP/IMAP’ and click on ‘Add a forwarding address’.

Paste the Email Address we copied earlier, and click on ‘Next’.

A dialogue box will pop up asking you for confirmation. ‘Proceed’ with forwarding to the given email address.

You will be asked to enter a confirmation code, which you will find under Response Received on Pabbly Connect.

Expand Response Received, copy the Confirmation Code, paste it into its given field, and click on ‘Verify’.

Enable Forwarding, click on ‘Save Changes’ and your connection will be established.

C. Test Connection

To test the established connection, click on ‘Re-Capture Email Parser Response’ and send a test email to your account using a different ID.

Switch to Pabbly Connect, and expand Response Received – under which the latest email details must be visible, thus confirming our connection.

Step 3:- Add Text Formatter to the Workflow

Salesforce requires us to enter the First and Last Names of your lead separately, but the data we captured from Gmail has the Full Name. To split this Full Name into two separate fields, we will add a Text Formatter to our workflow.

Choose ‘Text Formatter by Pabbly’ as your Action App, select ‘Split Text’ as an Action Event, and click on ‘Connect’.

In Text to Split Field, map the Full Name from the trigger step.

Enter ‘{{space}}’ as your Separator to split the text on either side of the space.

To retain the entire data on either side of the space, select ‘All’ as the Segment Index, and click ‘Save And Send Test Request’.

Full Name is now split into two separate parts.

Step 4:- Setup Salesforce as the Action App to Create Lead

Action allows us to choose the application that will get executed by the workflow trigger.
We essentially want to use the captured emails to create leads in Salesforce. Therefore, Salesforce will be our Action App.

Add another Action Step to your workflow by clicking the + button.

A. Action App

Choose ‘Salesforce’ as the Action App, select ‘Create Lead’ as your Action Event, and click on ‘Connect’.

Select ‘Add New Connection’, and click on ‘Connect With Salesforce’. Also, grant the authorization.

C. Map Necessary Fields

Now that you have connected your Salesforce account, all you need is to map the necessary details from the step above. Mapping ensures our data remains dynamic and changes as per the received responses.

Map the Last Name from the step above.

Similarly, map the other fields, leaving the unnecessary ones empty, and click on ‘Save & Send Test Request’.

Our automation is complete. We have successfully integrated Gmail with Salesforce. Each time you receive an email on Gmail, a new lead will automatically be created in your Salesforce account.

You can copy this entire workflow by clicking this link.

Sign Up for a free Pabbly Connect account, and start automating your business
Subscribe to our Youtube Channel for more such automation
For any other queries, visit our forum