by Glenn Richmond, on May 30, 2016

Once you have configured your CRM connection and selected which modules to enable Flexidocs for, you can access your document variables within your CRM.

The first step in creating your document is to create a Microsoft Word document as you normally would. Simply put in dummy values where your require your CRM variables and format the document as you would like it to appear.

Once you have done this, you can put your variables into your document. In this case, we’ll be selecting variables for the opportunities module, though this can be done for any module in which Flexidocs has been enabled. 

Selecting your Variables

Click the Menu to View Variables
Click the Menu to View Variables

Once you have done this, you will see a view of all variables available within the module.

Click the on any of the Variables to copy the variable to the Clipboard
Click the on any of the Variables to copy the variable to the Clipboard

Once you are in this screen, you will see variables from:

Direct Module Variables

  • These are fields that are within the module itself.

Related Variables

  • For any relate fields within the module, you are able to access all of the fields within that related record. To access these variables, scroll down to the related variables section, expand the variable and click on any fields that you would like to include within the document to copy the variable to your clipboard. You can then paste this to the word document.

Related Module Variables

  • This section allows us to include sets of related data into our documents. These variables cover the one to many and many to many relationships within our CRM. Since this can mean that there is more than one record that is associated with these relationships, the interface will allow you to select which variables you would like to include and then click Copy Selected Variables in order to copy the variable to the clipboard. However, when the variable is copied, the system will provide a for loop in order to allow the document to output each of the records that may be associated with that relationship. See the figure below for how this appears. 

Select Related Module Variables
Select Related Module Variables

The variable that results from clicking the Copy Selected Variables option in this case is: 


{foreach from=$class_milestones_opportunities item=IDENTIFIER}
Name: {$IDENTIFIER.name}
Description: {$IDENTIFIER.description}
Amount: {$IDENTIFIER.amount}
Expected Billing Date: {$IDENTIFIER.expected_billing_date}
{/foreach}


These variables can then be formatted any way you like within your Microsoft Word document and the content between the for loop will be replicated for each related record in that relationship.

See the figure below for an example of a formatted table that brings in related milestone records. 

Formatted Section in Word Document
Formatted Section in Word Document

Uploading your Document Templates

Once you have created your document templates, you can now upload your document to the Flexidocs platform in order to have it become available for generation. In order to do this, log into Flexidocs and navigate to your documents list:

https://console.flexidocs.co/documents

Click the New Document button in order to upload your template.

Create a new Document Template
Create a new Document Template

You will then see the screen shown below. This allows you to select your document, set the document name, and select which module this document should appear in within your CRM.

Create a new Document Template
Create a new Document Template

Once you have uploaded your document, the system will verify that you have valid variables within your document, and if successful, the system will indicate that this was a success.

Testing your Document

Once you have uploaded your document, the Flexidocs platform allows you to test your document merges. In order to do this, navigate to any document and click Test Document.

Navigate to Test Document
Navigate to Test Document

You will then be presented with a page that shows you your variables within the document and allows you to enter values and them perform a test merge.

Click to Test Document
Click to Test Document

If successful, the system will download your test document, which you can review to ensure that you’re happy with the output.