Import data from documents into Salesforce using Sensible and Zapier

Updated on
September 16, 2024
5
min read
Contributors
No items found.
Author
Import data from documents into Salesforce using Sensible and Zapier
Table of contents
Turn documents into structured data
Get started free
Share this post

Getting data from documents such as PDFs into Salesforce can be a real challenge. For example, imagine your proptech company analyzes lease information, but your company’s process for getting data from contract documents into Salesforce is slow. 

With Sensible's beta Zapier integration, you can take a low-code approach to transforming data in PDFs and other document file formats into emails, databases, Google Sheets, and other supported Zapier destinations. In this post, we’ll create a custom Salesforce object to hold lease contract information, then update it with a new record every time you upload a new contract document to Google Drive.

As an overview, you’ll extract key pieces of data from each lease using Sensible:

key data to extract from a lease contract

And send the data using Zapier to Salesforce, so that each document gets a record:

Overview

This blog post describes how to send extracted data from contracts into Salesforce using Sensible's Zapier integration. You’ll take the following steps: 

  • Create an LLM-powered configuration in Sensible to handle extracting data from lease contracts. 
  • Create a custom Lease object in Salesforce as a destination for the extracted data.
  • Create a Zap to trigger a Sensible extraction each time you upload a lease document to a Google drive folder:
Zap 1
  • Create a second Zap to create a new Salesforce record from the extracted data:
Zap 2

Configure Sensible

To configure Sensible, complete the following steps:

1. Get an account at sensible.so and complete the onboarding experience. 

2. Log into the Sensible app.

3. In the Document Types tab, click New document type to create a new document type. In the dialog:

- Download the following example document, then select it in the dialog for upload: Download link.

- For the document type name, enter  “lease_contracts”.

- For the configuration name, enter “test”.

- Deselect the Auto-generate configuration checkbox.

- Click Start extraction to create the document type.

upload the example lease and create a document type

4. Create LLM prompts to extract key pieces of information:

- Click Query group.

- Create queries as shown in the following screenshot, then click Extract. The extracted data appears below each query.

LLM queries and extracted document data

5. Click Publish configuration and choose Production environment so that you can use the queries to automate extracting data from similar documents.

Configure Salesforce

To configure Salesforce, take the following steps:

1. In the Salesforce Setup‘s Object Manager tab, click Create and select Custom Object. 

2. In the New Custom Object dialog, leave the defaults except for the fields shown in the following, and click New:

create custom Lease object

3. In the Fields & Relationships tab, create new fields corresponding to the fields you extracted in Sensible:

- Field label: lease_address - Select text as the type and 255 for the maximum length. Leave all other defaults.

- Field label: rent_amount - Select Currency as the type. Leave all other defaults.

- Field label: lease_start_date - Select Date as the type. Leave all other defaults.

4. Make it easy to find your leases by adding them to your tabs:

- From Setup, enter "Tabs" in the Quick Find box, and select "Tabs".

- In the Custom Tabs section, select New.

- From the Object dropdown, select Lease. Select a style under Tab Style, leave other defaults, and save. 

5. Exit Setup

Configure Zapier

As an overview, you’ll configure Zapier to trigger a Sensible data extraction from a lease when you upload it to Google Drive, then populate a new Salesforce record with the extracted data:

Zap 1

Zap 2

Zap 1: Trigger an extraction for each uploaded document

To configure the first Zap, take the following steps:

1. In Google Drive, create a folder named "test folder".

2. Upload a lease example to the folder: Download link

3. In Zapier, create a new Zap. Configure the trigger as shown:

configure trigger step 1
configure trigger step 2

4. Click Test trigger and choose the file you uploaded in a previous step. Note: You’re not limited to Google Drive for triggering Sensible extractions. For example, you can write Zaps to trigger Sensible extractions from email attachments or other supported Zapier sources.

5. Configure the action as shown in the following screenshots:

configure action step 1
configure action step 2

6. Test the extraction. You should see a response like the following:

test response

7. Publish and name the Zap.

Zap 2: for each new document extraction, create a new Salesforce record

To create the second Zap, take the following steps:

1. In Zapier, create a new Zap. Configure the trigger as shown in the following screenshots:

configure trigger step 1

2. Click Test trigger. Click the document extraction you created when you tested the previous Zap.

3. Configure the Action as shown in the following screenshots:

configure action step 1

4. Select Lease for the Salesforce object, then configure the field population. For each Salesforce field, select the correspondingly named parsed document field's value, as shown in the following screenshot:

configure action step 2

5. Click Test step. You should see results like the following:

test results

6. Publish and name your Zap.

Test your integration

Congratulations, your integration is now published and running! Take the following steps to continue building Salesforce records from example documents:

1.  Upload another following example leases to your Google Drive: Download link

2. Verify the extractions show up in Salesforce. For example, your results might look something like this, where each lease name is the ID of the corresponding extraction in Sensible:

multiple lease documents imported to Salesforce as records

Click each lease to view the data extracted from the lease document:

individual record details

Advanced: automating complex data

This post covered handling single-value key/value pairs extracted from documents. Sensible can also extract complex data objects from documents, such as tables and repeating layouts. For example, it can extract the fees in the example lease documents as a table:

To handle these complex document data fields in Zapier, create a spreadsheet of the extracted document output in your Sensible trigger by selecting Create Excel output. You can then work with each row in the table output or other extracted data object as a spreadsheet row in Zapier. For example, you can use Zapier’s Lookup Row and Loop actions to loop through the rows in the sheet. Or, use Sensible's SDKs to integrate with your own apps.

Start extracting

Congratulations, you've learned how to send document data to Salesforce using Sensible’s Zapier integration. There's more extraction power for you to uncover, from prebuilt extraction configurations for common business documents such as tax and business forms, to extracting from your own custom documents using SenseML, Sensible’s query language for extracting data from documents. Sign up for an account, check out our prebuilt configs in our open-source library, and peruse our docs to start extracting data from your own documents.

Turn documents into structured data
Get started free
Share this post

Turn documents into structured data

Stop relying on manual data entry. With Sensible, claim back valuable time, your ops team will thank you, and you can deliver a superior user experience. It’s a win-win.