How to Link Google Docs to Salesforce Records with a Custom URL Field

Do you need to link a Google doc to a Salesforce record? Do you need it done fast? There’s a quick, easy trick for getting it done: simply using a custom Salesforce URL field to link out to a document or folder in Google Drive.

Now, is this the best way to link Google docs to Salesforce records? I wouldn’t say so. Does it scale well at all? Absolutely not. But it’s fast, it’s simple, and everything you need to do it is pure Salesforce 101. Let’s take a look at how it works.

Creating a Custom URL Field

To add a custom URL field to a record page, navigate to the record where you’d like your custom field to appear and select Edit Object. You can also select your target object type directly from Object Manager in Setup.

Position of Edit Object menu item on a Salesforce record page

Go to the Fields and Relationships tab and select New.

Position of the New button in the Fields and Relationships tab

You’ll need to choose a type for your new field. Scroll to the bottom of the page and select URL.

Position of the URL option on the New Field screen

Give your field a label & name and click Next. In the screens that follow, you’ll be able to manage field-level security and page layouts for the new field.

New Custom Field page

Adding Your Custom URL Field to Page Layouts

Now that you’ve created your custom field, it’s time to make it visible in page layouts and list views. Go to the Page Layouts tab in Object Manager and select a layout to add the URL field to.

Page Layouts screen in Salesforce Setup

Drag the new field onto the page and click Save.

Dragging a new field on to a page layout

If you’ve done everything right, you’ll see the URL field on the page layout you added it to.

Position of the new URL field on a Salesforce account page

For added convenience, you can also add the shiny new URL field to a list view. Navigate to the list view of your choice, click the List View Controls button, and choose Select Fields to Display.

Position of the Select Fields to Display menu item

Find your new field in the Available Fields list, move it to the Visible Fields list, and click Save.

Moving the new field to the Visible Fields column in the Select Fields to Display modal

When you populate this field with a URL, the Google Drive link will be available and clickable from this list view.

Position of the new field on a list view

Linking Google Docs to Salesforce with a Custom URL Field

From here on out, it’s pretty simple – just go through your records and paste in the link to whichever Google Drive folder or file you’d like to add to the page. If you spend a lot of time in Google Drive and Salesforce, we might not need to walk you through this part. But just to cover our bases, let’s take this step by step.

First, head over to Google Drive, navigate to the folder or file you’d like to link to, and select Get Link.

Position of the Get Link menu option in Google Drive

Copy the link and make sure that the selected security settings will grant access to everyone who needs to interact with it in Salesforce.

Get Link modal with Copy Link button in Google Drive

Head back to Salesforce, edit your selected record, paste in the Google Drive link, and click Save.

New URL field in Salesforce with Google Drive link inserted

And just like that…you’ve created a link to Google Drive from Salesforce!

Screenshot of completed link creation

Again, this isn’t the most sophisticated way to link Google docs to Salesforce records, but it has its selling points – it’s fast, free, and fairly easy. Having said that, if you spend a lot of time in these environments, it gets old clicking back and forth between tabs, and if you want one-click access to multiple folders, your page layouts are going to get very cluttered very quickly.

For a more powerful solution that’s just as easy to get up and running, check out Drive Connect, our AppExchange application that allows you to work with your Google Drive files directly from a Lightning component within Salesforce.

Try Drive Connect for Free

You can use the app for 14 days with no credit card required.

Get Started