Start Here: Basic Configuration

To get started using the A5 Documents app, follow the steps below.

  1. Install & Authorize the App
  2. Set User Permissions
  3. Create a Google Doc File
  4. Adjust Google Doc Sharing Settings
  5. Create Document Action
  6. Create a Custom Button for Document Generation
  7. Execute Any Document Button

Install & Authorize the App

  • Go to the AppExchange profile for A5 Documents and click the Get It Now button.
  • Follow the steps prompted to install the package in Production or Sandbox org. After you click to install, you will be prompted to grant third-party access to several  Google websites in order to use the A5 Documents app. Click yes to authorize.
  • Once you have installed, go to the app launcher and open A5 Documents.
  • Open the DocGen Configuration tab.
  • Verify that in the browser you’re logged into the Google Account that you intend to authorize and that it is the only Google account that you are logged into.
  • Click Grant Access to authorize the Google account you would like to use with A5 Documents.
    • If the Grant Access button is blue, this means that you have not yet granted access.
    • If the Revoke Access button is red, this means that you have already granted access.
    • To revoke access, click the red Revoke Access button. You may revoke access at any time.
  • You will be prompted to select an existing Google Drive account to use.
    • If you don’t have a Google Drive account already, create a free account prior to this step.
    • If your company uses Google Workspace, you can authorize a company drive.
    • Each A5 Documents user will have to authorize the app with their own Google Drive account in order to use the app and generate documents. Alternatively, there is an option to authorize one Google Drive account for all of your users to use when generating documents. See this article for more detail: Authorize One Google Drive Org Wide.

Set User Permissions

Each user will need the following permissions in order to be able to use the app properly. This may be less relevant if you’re just trying out the app with a free trial; however, once the trial has ended, make sure to check the following Permissions for your users before going live with your company.

  • Access to A5 Documents app components. You can review all app package components that users may need access by going to Setup > Installed Packages > A5 Documents app > View Components.
  • Edit access to the Document Action base object and each field that is being merged into the document.
  • Edit access to any fields that the Document Action is trying to update. For example, a URL text field that will get populated with a Google Doc link.

Create a Google Doc File

A5 Documents uses Google Docs to create templates with Salesforce merge data. To create the Google Doc that will become your template, you have several options:

Once you create the document:

  • Give the Google Doc template a title. We recommend adding at least one merge field so that it merges a unique filename related to the record. You’ll be able to do this later in the configuration process via the Document Action Template Builder. For now, just add placeholder text.
  • Customize the Google Document by adding any textimages, and tables directly into the document that you want to be consistent elements within the template.

  • If you don’t want your table to look like a table, you can make the border of your table invisible by changing the Table Border setting to 0 point in Table Properties. You could also change the color of the border to white.
  • Keep the tab with your Google Document open — you’ll need the Google Doc ID when you create your Document Action. Find the Google Doc ID in the URL after document/d/ and before /edit. Do not include “/”. See example below:

Adjust Google Doc Sharing Settings

Each user who is generating documents will need at least view access to a Document Action’s Google Document template (i.e. the Google Doc file) in order to generate documents. If in the Document Action settings you specify a Google Drive folder where all generated documents from the Document Action will be stored (in the Folder ID field), each user generating documents will need edit access to that Google Drive folder.

You can share a Google Doc file or Google Drive folder with specific people, groups, or based on the link, and set the level of access to view, comment, or edit. The options you see depends on whether your account is an individual Gmail account or a Google Workspace.

  1. Restricted – Only specific individuals with the link can (view/comment/edit) the document. Set the level of access (view/comment/edit) for each person/group individually in “Share with people and groups” section.
  2. [Company Name] – If using Google workspace, anyone signed into an account in your organization with the link can (view/comment/edit) the document.
  3. Anyone with the link – Anyone with the link can (view/comment/edit) the document.  This is the most popular option that most app customers use. Anyone who has the full Google Doc link can access. No sign-in to Google Drive required and other users will be able to access the Google Doc template within the Document Action Template Builder.

If you do not see the Anyone with the link as an option for sharing/permission settings on your Google doc, then you have restricted sharing settings set on your company Google Drive. The Administrator of your drive will need to alter the settings to be able to generate documents with app. See this article for more detail: Do Not See “Anyone with the link” Sharing Option.

Additional References:

Create a Document Action

Now that you’ve authorized the app and created a Google Doc for your Document Action template, it is time to create the Document Action. A Document Action record sets all the parameters for your document generation. Access your Document Actions in the Document Actions tab. Create a new Document Action by clicking on the New button in top right corner.

Overview of Document Action Fields and Features

Section: “Information”

Field Name Description
Action ID Auto-numbered ID for Document Action identification.
Base Object API Provide the API name of the base object from which you’ll be merging data.

  • Standard Objects: See this article, API Names of Standard Salesforce Objects
  • Custom Objects: To access API names for custom objects, go to Setup>Object Manager> click on the custom object. You’ll see the API Name field in the Detail section.
Action Name This is a reference name for your Document Action (e.g. “Email and Download Invoice”, “Email Quote Autosend”, etc.)
Template Document ID Paste into this field the Google Doc ID of the Google Doc you want to use as your Document Action Template. For more information, seeCreate a Google Docs File and Adjust Sharing Settings
Folder ID Optional. Specifies a Google Drive folder where all generated documents from this Document Action will be stored. To use this feature, paste the Google Drive folder ID into this field. 

  • Any users who are generating documents will need edit access to this folder.
  • To find the Google Drive folder ID, navigate to the folder in Google Drive. Copy everything that comes after “folder/” in the URL. For example,  with the URL: “”, the Folder ID would be “1dyUEebFkGa4LkM7onBF_VAXQ7mfUH44g”.
Group Optional. Assigns your Document Action to a Group. This allows you to filter your document actions when using the “Execute any Document Action” feature.

  • The default Group names are Group 1, Group 2, Group 3; however, they can be customized. See this article for more information: Execute Any Document Action
Field To Update

Field To Update Value

Optional. Allows you to update a field after you generate the document on the record. For example, if the base object of the Document Action were the Opportunity object, you could have the Stage update to “Invoice Sent” after the invoice is generated.

  • When using the update field feature , please be aware that this action will be performed as the last step of the document generation process. If you have set the Document Action to Preview, the field update will execute before redirecting to the email preview page. In the email preview page, if the user clicks Cancel and does not send the email, the field update will still have already been executed on the related record.

Section: “Properties of Merged Document in Google Drive”

Field Name Description
Visibility Defines the visibility options for the generated document. Options are the same as Google Docs sharing settings: Private, Company, Link, Public.

  • Private – Only you can access. No one else will be able to generate a document with this setting or access your generated document. If you are the only user generating documents and using the app, then you can use this setting. 
  • Company – Use this option if you have Google Work. Setting Visibility to Company will allow any users in your company to have access to the merged document from their “Shared with Me” folder in Google Drive. 
  • Link – This allows anyone with the link to access the generated document if they have the full Google Doc URL. This is the most common level of visibility chosen by customers and allows you to merge the field where the Google Doc URL is saved into the body of an email template so that the recipient can click the link and open the Google Doc in a new window of their browser.

If using a Google Work account, note that some companies have their security settings at the admin level that do not allow their users to share any Google Docs publicly, i.e. Anyone with the link. Usually it would instead be set as Anyone with the link at your company can view. If you your company settings do not allow you share publicly, then you would not be able to set the Document Action to share with Anyone with the link. You would need to change your admin level security to accommodate this. See this article for more detail: Authorize One Google Drive Org Wide.

Save URL to Salesforce Field Optional. Paste the API of a custom field on the Document Action’s base object where you’d like to automatically save the URL of the generated Google Doc. Use field type URL to save the URL as a clickable link. If you would like more detailed steps, see this article: Create URL Field in Document Action.
Access Set the Access options for the document you are going to generate. Options are the same as Standard Google Docs options: Viewer, Commenter, Editor. 

Delete Google Doc After Merge When selected, this option deletes the Google Doc after it is merged. This means that the Google Doc won’t be stored on your Google Drive. In the next section, Properties of Merged Document in Salesforce you’ll want to select Attach File to Record so that the only place it is saved is in Salesforce, attached to the related record. 
Redirect To Set where the process will redirect after generating the document. This feature can only be used for manual document generation. If using a custom button, it defaults to “Record”. 

  • None – If selected, will revert to default.
  • Record – Default option. Redirects to the record from which the process was invoked. 
  • Google Doc – Redirects to the generated Google Doc. 
  • Custom URL – Specify any publicly accessible URL such as a company website.
Redirect Custom URL If you selected Redirect to Custom URL, paste the URL into this field.

Section: “Properties of Merged Document in Salesforce”

Field Name Description
Attach File to Record Check this box to attach a copy of the generated document to the Salesforce record. 

  • The default is for the file to be attached as an Attachment and show under your Notes & Attachments related list on the object’s page layout. If you’d prefer to use Documents (Classic only) or Files (Lightning only), go to Setup > Custom Settings > A5 Documents Settings > Manage > Edit > select Use Files or Use Documents checkbox and save. 
Output Format Required if you select “Attach File to Record”. Supported formats include:

  • docx
  • html
  • odt
  • pdf
  • rtf
  • txt
Documents Folder Optional. If you choose  to use Documents instead of Files or Attachments, the file won’t be attached to the record as it is not a related list. It will be stored in the Documents‘ tab. If you would like to specify a folder for the generated documents to go into under Documents, click to modify Document Action page layout and add the custom field Documents Folder to the layout (suggested placement next to Google Doc ID/Folder ID in top section). Then paste your Document Unique Name into this field on document action. The unique name will be formatted like an API name, with no spaces.
Download File Optional. If you check this box, a copy of the generated document will go to your downloads folder on your computer.

  • It is mandatory that you allow popups from Salesforce as browsers are interpreting this download action as a popup in a new window. 

Section: “Additional Documents to Merge”

If you need to merge additional existing PDFs with your generated document you may do so using the PDF Merge feature. Please contact support if interested in enabling this feature with your app subscription.

Section: “Email”

This entire section is optional. The Email feature allows you to automatically or manually email newly generated documents. In order to use this feature, make sure that all users generating documents have the Allow Activities checkbox checked on the standard or custom object being used as base object in the Document Action.

Field Name Description
Email File As
  • Link – This option provides a link to the generated Google Doc File.
  • Attachment – This option attaches the file to the email.

Pros/Cons: Attachments are static and take up storage space in your org. Google Docs can be updated dynamically and take up no space.

Email Template Email Template Id of the template that will be used to send the email. Starts with OOX. Only Classic Email Templates are supported. 

  • If you are using A5 Documents with A5 Signature, you can use the email template we include with the A5 Signature installed package, Send for eSignature. If you opt to create your own template, remember to include the eSignature link in the email body: {!esign__Document__c.esign__eSign_Link__c}.
Email Action
  • Autosend – Emails the document instantly.
  • Preview – Allows you to review the merged document and email settings before emailing.
Email To
  • Supported formats are API field name (e.g. “{!Contact.Id}”) or hardcoded Contact/Lead Salesforce Id (e.g. “0056g000002HtQtPAK”). Both 15 and 18 character Ids are supported.
  • The Email To field in a Document Action must result in providing either a Contact Id or Lead Id. If the base object is not the Contact or Lead object, you’ll need to create a custom lookup field to the Contact or Lead object that’s located on your base object (e.g. “{!Opportunity.Primary_Contact__c}”). 
  • For more detailed steps, see this article: Using Email To Field in Document Action
Email Additional To, Email BCC, Email CC
  • These fields are used to specify additional email addresses that will be put into the To, CC or BCC email fields.
  • Unlike Email To, these fields do not have to result in providing a Contact/Lead Id, so if you have an email address stored in a text field or email field, you can enter the API field name (e.g. “{!Opportunity.Billing_Email__c}”).
  • You can use the Email Additional To field instead of the Email To field when you email a document.
  • Enter multiple email addresses separated by a comma.
Email From Org Wide Address Optionally you can set a default email address that you want the email to be sent from. See this article for more detail: Email From Org Wide Address.

Section: “eSignature”

This section is only to be used if combining automation with our A5 Signature app to send generated documents for eSignature. You can see step by step documentation in this article: Using A5 Documents with A5 Signature for Full Automation.

Section: “Button/Link Formula”

The app generates custom button/link code in this section for you to copy/paste into a custom button on the base object. See next section for detailed steps to create a custom button for document generation. Whenever you save edits to your Document Action, you will need to copy the code in the Button/Link Formula section and update the button/link code.

Create a Custom Button for Document Generation

To initiate document generation, you need to create a button or link on the Document Action’s base object, then add the button/link to the page layout. This button will allow you to execute a specific Document Action from a record on your base object. For steps to create one button that executes any Document Action on a specific base object, skip to the next section.

Copy Custom Button Code

Go to the Document Action record, section: Button/Link Formula and copy the custom code. This example button code shows a Document Action on Opportunity base object.

Create a New Button or Link

To create a new button, go to Setup > Object Manager >  [select Document Action’s base object] >Buttons, Links, and Actions>New Button or Link.

Configure the Button

In the Custom Button or Link Editor, configure settings as follows, then save:

  • Enter a Label (e.g. “Email Quote”)
  • Choose whether it will be a Detail Page Button or Detail Page link.
  • Select behavior Display in Existing Window with Sidebar.
  • Leave the Content Source as URL
  • Copy and paste into the Editor box the value from the Button/Link code in document action that you saved to clipboard from previous steps.

Add the Button or Link to the Page Layout

To add the button or link to the page layout, go to Setup > Object Manager > [select Document Action’s base object] > Page Layouts> [select the page layout where you’ll add the button/link].

Add a Custom Button to the Page Layout in Lightning Experience

To add a custom button to an object’s page layout in Lightning Experience, go to Mobile & Lightning Actions list in the page layout editor. Find the custom button you just created and drag it onto the Salesforce Mobile and Lightning Experience Actions section, then save.

Add a Custom Link to the Page Layout in Lightning Experience

To add a custom link to an object’s page layout in Lightning Experience, go to Custom Links list in the page layout editor. Find the custom link you just created and drag it onto the Custom Links section, then save.

Add a Custom Button to the Page Layout in Classic

To add a button to the page layout in Classic, click Buttons and then drag the button into the [Object] Detail section, under Custom Buttons, then save.

After you click the button, it will redirect you to the record page with the Status information of your Document Generation process. If you set the Document Action to email with preview, you will be shown a preview of the email with the attached document.


  • Every time you make changes to a Document Action record, you’ll also need to update your custom button or link, as the changes will not be passed automatically.
  • If interested in placing your custom button on a list view to mass generate documents from an object, see this article for more detail.

Create an “Execute Any Document” Button

Once you have more than two buttons on an object, we recommend configuring the Execute any Document Action button. This optional feature allows you to create a single button that allows users to click and select any document action on a base object. You can also assign document actions to a specific group, which allows the user to filter document actions listed. Group names are fully customizable. See this article for more information: Execute Any Document Button.

Was This Article Helpful?


There are no comments yet

Leave a comment

Your email address will not be published. Required fields are marked *