Blog

Create PDFs and Reports from Knack

Blog

Create PDFs and Reports from Knack

Blog

Create PDFs and Reports from Knack

Blog

Create PDFs and Reports from Knack

Blog

Create PDFs and Reports from Knack

Download PDFDownload PDF
Blog

Create PDFs and Reports from Knack

Formstack
/
November 6, 2014
Blog

Create PDFs and Reports from Knack

MIN
/
November 6, 2014
About the Episode
Episode Highlights
Meet our Guest
Episode Transcript

If you're looking for an easy way to build an online database application without the need for programming, you need to check out Knack.  With Knack you can get rid of those clunky spreadsheets and build easy to use web applications such as a custom CRM, proposal tracker, order management, and more.  Knack allows you to build some pretty powerful apps and we're going to show you how you can easily generate documents directly from Knack using Formstack Documents.

In this example, we’re going to show you how to generate a contract and send it to our customer directly from a Knack CRM application.  First, we’ll setup our contract template in Formstack Documents, then we’ll add a custom button to our Knack application that will send our client data to Formstack Documents to generate the contract.

For our contract, we’re going to use a Word document as the document type.  In the document we are going to add all of the normal contract terms, and then we’ll add the Formstack Documents merge fields (ie {$company_name}, {$address}, etc) where we want the Knack data to go.  Here’s what our contract template looks like:
Â


After we upload our document to Formstack Documents, we need to make sure we update the email delivery settings so that the contract is emailed to our client.  You can make these changes under the Deliver tab.  You’ll want to change the “To” address to the merge field for the email address.  If you don’t have an email address merge field setup yet, simply click the <> option and type in {$email}.  This will add “email” as a merge field.

On the Merge tab inside Formstack Documents, you’ll notice there is a “Merge URL” for your document.  This is the unique URL that you’ll use when sending data to Formstack Documents to populate your contract.  Save this for later.

Next, let’s jump into Knack and setup the custom button that will be used to generate a contract for a specific client.  The setup process is pretty straight forward, but it is a little technical.  We’ve tried to include as many examples as we could to help you, but Knack has a great support team that is more than happy to help with this custom coding.

We’re going to use Javascript to customize our Knack application to show a “Create Contract” button on our Client Detail page.  To edit the Javascript for our application, we’re going to go to the API & Code page in our application settings.  Once there, click the Javascript tab and you should see a code editor (text box).  This is where we are going to use jQuery to manipulate our page.
Â


We’re going to use this code snippet as a starting point for our application.  There are a few things that you need to figure out when setting up the javascript:

  1. Which “Scene” is your page in
  2. Which “View” in that scene is your page
  3. What the Field IDs are that you need to send to Formstack Documents

The easiest way to find this information is to “inspect” the HTML in your browser (either using the built-in development tools or using a plugin like Firebug).  You will be looking for elements in the HTML like

and

.   These IDs will be important in our javascript.

When a new scene loads, an event is fired and we can capture that with jQuery.  You’ll notice the first line in our code example is looking for “$(document).on('knack-scene-render.scene_3', …”  - This event will fire when our scene is rendered.  This is when we want to add the button to our view page.

To add the button to our view page, we’re going to use jQuery to create a new div container that will contain our button.  Then we will attach an event handler on the button that will use AJAX to send the data to our Formstack Documents contract.  Here’s what our code looks like:



As you’ll see in the code above, we add the link to our page, set an event handler that uses AJAX to send the contact data to Formstack Documents (using our Merge URL) and displays a message when complete.  This happens behind the scenes without ever having to leave Knack!

Here’s what the button looks like in action:
Â


Let’s click that button!  Everything worked great and here’s the document we have generated.  All of our data from Knack is in the document and it has been emailed off to the client.  How’s that for easy?
Â

Â
Wait, there’s more…

Generate and Download Merged Document

Creating a document behind the scenes is cool, but what if you want to open up the document right away without having to go to your email?  No problem, here is an updated code example that will generate a link that sends data to Formstack Documents in a new window rather than AJAX and then your document will be there for you

Use Repeatable/Loop Data

Do you have repeating data that is being printed into a table and you want those line items to come through to Formstack Documents? No problem! Check out the example code below:


Â

Automatically Generate Documents

If you’re looking to automatically generate documents every time a new record is added to your Knack application, you can automate the process by using Zapier.  Zapier will detect new records and send that new data over to Formstack Documents without anyone needing to click a button.  Setup is quite simple and all you need to do is map your Knack fields to the Formstack Documents fields and Zapier will handle the rest.

Blog

Create PDFs and Reports from Knack

Blog

Create PDFs and Reports from Knack

Get the Report

Great, thank ya!

You can now access the content.
Oops! Something went wrong while submitting the form.
Blog

Create PDFs and Reports from Knack

Panelists
No items found.
Introduction
Introduction

Great, thank ya!

You can now access the content.
Download NowDownload Now
Oops! Something went wrong while submitting the form.

If you're looking for an easy way to build an online database application without the need for programming, you need to check out Knack.  With Knack you can get rid of those clunky spreadsheets and build easy to use web applications such as a custom CRM, proposal tracker, order management, and more.  Knack allows you to build some pretty powerful apps and we're going to show you how you can easily generate documents directly from Knack using Formstack Documents.

In this example, we’re going to show you how to generate a contract and send it to our customer directly from a Knack CRM application.  First, we’ll setup our contract template in Formstack Documents, then we’ll add a custom button to our Knack application that will send our client data to Formstack Documents to generate the contract.

For our contract, we’re going to use a Word document as the document type.  In the document we are going to add all of the normal contract terms, and then we’ll add the Formstack Documents merge fields (ie {$company_name}, {$address}, etc) where we want the Knack data to go.  Here’s what our contract template looks like:
Â


After we upload our document to Formstack Documents, we need to make sure we update the email delivery settings so that the contract is emailed to our client.  You can make these changes under the Deliver tab.  You’ll want to change the “To” address to the merge field for the email address.  If you don’t have an email address merge field setup yet, simply click the <> option and type in {$email}.  This will add “email” as a merge field.

On the Merge tab inside Formstack Documents, you’ll notice there is a “Merge URL” for your document.  This is the unique URL that you’ll use when sending data to Formstack Documents to populate your contract.  Save this for later.

Next, let’s jump into Knack and setup the custom button that will be used to generate a contract for a specific client.  The setup process is pretty straight forward, but it is a little technical.  We’ve tried to include as many examples as we could to help you, but Knack has a great support team that is more than happy to help with this custom coding.

We’re going to use Javascript to customize our Knack application to show a “Create Contract” button on our Client Detail page.  To edit the Javascript for our application, we’re going to go to the API & Code page in our application settings.  Once there, click the Javascript tab and you should see a code editor (text box).  This is where we are going to use jQuery to manipulate our page.
Â


We’re going to use this code snippet as a starting point for our application.  There are a few things that you need to figure out when setting up the javascript:

  1. Which “Scene” is your page in
  2. Which “View” in that scene is your page
  3. What the Field IDs are that you need to send to Formstack Documents

The easiest way to find this information is to “inspect” the HTML in your browser (either using the built-in development tools or using a plugin like Firebug).  You will be looking for elements in the HTML like

and

.   These IDs will be important in our javascript.

When a new scene loads, an event is fired and we can capture that with jQuery.  You’ll notice the first line in our code example is looking for “$(document).on('knack-scene-render.scene_3', …”  - This event will fire when our scene is rendered.  This is when we want to add the button to our view page.

To add the button to our view page, we’re going to use jQuery to create a new div container that will contain our button.  Then we will attach an event handler on the button that will use AJAX to send the data to our Formstack Documents contract.  Here’s what our code looks like:



As you’ll see in the code above, we add the link to our page, set an event handler that uses AJAX to send the contact data to Formstack Documents (using our Merge URL) and displays a message when complete.  This happens behind the scenes without ever having to leave Knack!

Here’s what the button looks like in action:
Â


Let’s click that button!  Everything worked great and here’s the document we have generated.  All of our data from Knack is in the document and it has been emailed off to the client.  How’s that for easy?
Â

Â
Wait, there’s more…

Generate and Download Merged Document

Creating a document behind the scenes is cool, but what if you want to open up the document right away without having to go to your email?  No problem, here is an updated code example that will generate a link that sends data to Formstack Documents in a new window rather than AJAX and then your document will be there for you

Use Repeatable/Loop Data

Do you have repeating data that is being printed into a table and you want those line items to come through to Formstack Documents? No problem! Check out the example code below:


Â

Automatically Generate Documents

If you’re looking to automatically generate documents every time a new record is added to your Knack application, you can automate the process by using Zapier.  Zapier will detect new records and send that new data over to Formstack Documents without anyone needing to click a button.  Setup is quite simple and all you need to do is map your Knack fields to the Formstack Documents fields and Zapier will handle the rest.

Panelists
No items found.
Infographic

Create PDFs and Reports from Knack

Follow this quick and easy tutorial to start creating PDFs and reports from data in your Knack account.
Download InfographicDownload Infographic

If you're looking for an easy way to build an online database application without the need for programming, you need to check out Knack.  With Knack you can get rid of those clunky spreadsheets and build easy to use web applications such as a custom CRM, proposal tracker, order management, and more.  Knack allows you to build some pretty powerful apps and we're going to show you how you can easily generate documents directly from Knack using Formstack Documents.

In this example, we’re going to show you how to generate a contract and send it to our customer directly from a Knack CRM application.  First, we’ll setup our contract template in Formstack Documents, then we’ll add a custom button to our Knack application that will send our client data to Formstack Documents to generate the contract.

For our contract, we’re going to use a Word document as the document type.  In the document we are going to add all of the normal contract terms, and then we’ll add the Formstack Documents merge fields (ie {$company_name}, {$address}, etc) where we want the Knack data to go.  Here’s what our contract template looks like:
Â


After we upload our document to Formstack Documents, we need to make sure we update the email delivery settings so that the contract is emailed to our client.  You can make these changes under the Deliver tab.  You’ll want to change the “To” address to the merge field for the email address.  If you don’t have an email address merge field setup yet, simply click the <> option and type in {$email}.  This will add “email” as a merge field.

On the Merge tab inside Formstack Documents, you’ll notice there is a “Merge URL” for your document.  This is the unique URL that you’ll use when sending data to Formstack Documents to populate your contract.  Save this for later.

Next, let’s jump into Knack and setup the custom button that will be used to generate a contract for a specific client.  The setup process is pretty straight forward, but it is a little technical.  We’ve tried to include as many examples as we could to help you, but Knack has a great support team that is more than happy to help with this custom coding.

We’re going to use Javascript to customize our Knack application to show a “Create Contract” button on our Client Detail page.  To edit the Javascript for our application, we’re going to go to the API & Code page in our application settings.  Once there, click the Javascript tab and you should see a code editor (text box).  This is where we are going to use jQuery to manipulate our page.
Â


We’re going to use this code snippet as a starting point for our application.  There are a few things that you need to figure out when setting up the javascript:

  1. Which “Scene” is your page in
  2. Which “View” in that scene is your page
  3. What the Field IDs are that you need to send to Formstack Documents

The easiest way to find this information is to “inspect” the HTML in your browser (either using the built-in development tools or using a plugin like Firebug).  You will be looking for elements in the HTML like

and

.   These IDs will be important in our javascript.

When a new scene loads, an event is fired and we can capture that with jQuery.  You’ll notice the first line in our code example is looking for “$(document).on('knack-scene-render.scene_3', …”  - This event will fire when our scene is rendered.  This is when we want to add the button to our view page.

To add the button to our view page, we’re going to use jQuery to create a new div container that will contain our button.  Then we will attach an event handler on the button that will use AJAX to send the data to our Formstack Documents contract.  Here’s what our code looks like:



As you’ll see in the code above, we add the link to our page, set an event handler that uses AJAX to send the contact data to Formstack Documents (using our Merge URL) and displays a message when complete.  This happens behind the scenes without ever having to leave Knack!

Here’s what the button looks like in action:
Â


Let’s click that button!  Everything worked great and here’s the document we have generated.  All of our data from Knack is in the document and it has been emailed off to the client.  How’s that for easy?
Â

Â
Wait, there’s more…

Generate and Download Merged Document

Creating a document behind the scenes is cool, but what if you want to open up the document right away without having to go to your email?  No problem, here is an updated code example that will generate a link that sends data to Formstack Documents in a new window rather than AJAX and then your document will be there for you

Use Repeatable/Loop Data

Do you have repeating data that is being printed into a table and you want those line items to come through to Formstack Documents? No problem! Check out the example code below:


Â

Automatically Generate Documents

If you’re looking to automatically generate documents every time a new record is added to your Knack application, you can automate the process by using Zapier.  Zapier will detect new records and send that new data over to Formstack Documents without anyone needing to click a button.  Setup is quite simple and all you need to do is map your Knack fields to the Formstack Documents fields and Zapier will handle the rest.

If you're looking for an easy way to build an online database application without the need for programming, you need to check out Knack.  With Knack you can get rid of those clunky spreadsheets and build easy to use web applications such as a custom CRM, proposal tracker, order management, and more.  Knack allows you to build some pretty powerful apps and we're going to show you how you can easily generate documents directly from Knack using Formstack Documents.

In this example, we’re going to show you how to generate a contract and send it to our customer directly from a Knack CRM application.  First, we’ll setup our contract template in Formstack Documents, then we’ll add a custom button to our Knack application that will send our client data to Formstack Documents to generate the contract.

For our contract, we’re going to use a Word document as the document type.  In the document we are going to add all of the normal contract terms, and then we’ll add the Formstack Documents merge fields (ie {$company_name}, {$address}, etc) where we want the Knack data to go.  Here’s what our contract template looks like:
Â


After we upload our document to Formstack Documents, we need to make sure we update the email delivery settings so that the contract is emailed to our client.  You can make these changes under the Deliver tab.  You’ll want to change the “To” address to the merge field for the email address.  If you don’t have an email address merge field setup yet, simply click the <> option and type in {$email}.  This will add “email” as a merge field.

On the Merge tab inside Formstack Documents, you’ll notice there is a “Merge URL” for your document.  This is the unique URL that you’ll use when sending data to Formstack Documents to populate your contract.  Save this for later.

Next, let’s jump into Knack and setup the custom button that will be used to generate a contract for a specific client.  The setup process is pretty straight forward, but it is a little technical.  We’ve tried to include as many examples as we could to help you, but Knack has a great support team that is more than happy to help with this custom coding.

We’re going to use Javascript to customize our Knack application to show a “Create Contract” button on our Client Detail page.  To edit the Javascript for our application, we’re going to go to the API & Code page in our application settings.  Once there, click the Javascript tab and you should see a code editor (text box).  This is where we are going to use jQuery to manipulate our page.
Â


We’re going to use this code snippet as a starting point for our application.  There are a few things that you need to figure out when setting up the javascript:

  1. Which “Scene” is your page in
  2. Which “View” in that scene is your page
  3. What the Field IDs are that you need to send to Formstack Documents

The easiest way to find this information is to “inspect” the HTML in your browser (either using the built-in development tools or using a plugin like Firebug).  You will be looking for elements in the HTML like

and

.   These IDs will be important in our javascript.

When a new scene loads, an event is fired and we can capture that with jQuery.  You’ll notice the first line in our code example is looking for “$(document).on('knack-scene-render.scene_3', …”  - This event will fire when our scene is rendered.  This is when we want to add the button to our view page.

To add the button to our view page, we’re going to use jQuery to create a new div container that will contain our button.  Then we will attach an event handler on the button that will use AJAX to send the data to our Formstack Documents contract.  Here’s what our code looks like:



As you’ll see in the code above, we add the link to our page, set an event handler that uses AJAX to send the contact data to Formstack Documents (using our Merge URL) and displays a message when complete.  This happens behind the scenes without ever having to leave Knack!

Here’s what the button looks like in action:
Â


Let’s click that button!  Everything worked great and here’s the document we have generated.  All of our data from Knack is in the document and it has been emailed off to the client.  How’s that for easy?
Â

Â
Wait, there’s more…

Generate and Download Merged Document

Creating a document behind the scenes is cool, but what if you want to open up the document right away without having to go to your email?  No problem, here is an updated code example that will generate a link that sends data to Formstack Documents in a new window rather than AJAX and then your document will be there for you

Use Repeatable/Loop Data

Do you have repeating data that is being printed into a table and you want those line items to come through to Formstack Documents? No problem! Check out the example code below:


Â

Automatically Generate Documents

If you’re looking to automatically generate documents every time a new record is added to your Knack application, you can automate the process by using Zapier.  Zapier will detect new records and send that new data over to Formstack Documents without anyone needing to click a button.  Setup is quite simple and all you need to do is map your Knack fields to the Formstack Documents fields and Zapier will handle the rest.

Collecting payments with online forms is easy, but first, you have to choose the right payment gateway. Browse the providers in our gateway credit card processing comparison chart to find the best option for your business. Then sign up for Formstack Forms, customize your payment forms, and start collecting profits in minutes.

Online Payment Gateway Comparison Chart

NOTE: These amounts reflect the monthly subscription for the payment provider. Formstack does not charge a fee to integrate with any of our payment partners.

FEATURES
Authorize.Net
Bambora
Chargify
First Data
PayPal
PayPal Pro
PayPal Payflow
Stripe
WePay
ProPay
Monthly Fees
$25
$25
$149+
Contact First Data
$0
$25
$0-$25
$0
$0
$4
Transaction Fees
$2.9% + 30¢
$2.9% + 30¢
N/A
Contact First Data
$2.9% + 30¢
$2.9% + 30¢
10¢
$2.9% + 30¢
$2.9% + 30¢
$2.6% + 30¢
Countries
5
8
Based on payment gateway
50+
203
3
4
25
USA
USA
Currencies
11
2
23
140
25
23
25
135+
1
1
Card Types
6
13
Based on payment gateway
5
9
9
5
6
4
4
Limits
None
None
Based on payment gateway
None
$10,000
None
None
None
None
$500 per transaction
Form Payments
Recurring Billing
Mobile Payments
PSD2 Compliant

If you're looking for an easy way to build an online database application without the need for programming, you need to check out Knack.  With Knack you can get rid of those clunky spreadsheets and build easy to use web applications such as a custom CRM, proposal tracker, order management, and more.  Knack allows you to build some pretty powerful apps and we're going to show you how you can easily generate documents directly from Knack using Formstack Documents.

In this example, we’re going to show you how to generate a contract and send it to our customer directly from a Knack CRM application.  First, we’ll setup our contract template in Formstack Documents, then we’ll add a custom button to our Knack application that will send our client data to Formstack Documents to generate the contract.

For our contract, we’re going to use a Word document as the document type.  In the document we are going to add all of the normal contract terms, and then we’ll add the Formstack Documents merge fields (ie {$company_name}, {$address}, etc) where we want the Knack data to go.  Here’s what our contract template looks like:
Â


After we upload our document to Formstack Documents, we need to make sure we update the email delivery settings so that the contract is emailed to our client.  You can make these changes under the Deliver tab.  You’ll want to change the “To” address to the merge field for the email address.  If you don’t have an email address merge field setup yet, simply click the <> option and type in {$email}.  This will add “email” as a merge field.

On the Merge tab inside Formstack Documents, you’ll notice there is a “Merge URL” for your document.  This is the unique URL that you’ll use when sending data to Formstack Documents to populate your contract.  Save this for later.

Next, let’s jump into Knack and setup the custom button that will be used to generate a contract for a specific client.  The setup process is pretty straight forward, but it is a little technical.  We’ve tried to include as many examples as we could to help you, but Knack has a great support team that is more than happy to help with this custom coding.

We’re going to use Javascript to customize our Knack application to show a “Create Contract” button on our Client Detail page.  To edit the Javascript for our application, we’re going to go to the API & Code page in our application settings.  Once there, click the Javascript tab and you should see a code editor (text box).  This is where we are going to use jQuery to manipulate our page.
Â


We’re going to use this code snippet as a starting point for our application.  There are a few things that you need to figure out when setting up the javascript:

  1. Which “Scene” is your page in
  2. Which “View” in that scene is your page
  3. What the Field IDs are that you need to send to Formstack Documents

The easiest way to find this information is to “inspect” the HTML in your browser (either using the built-in development tools or using a plugin like Firebug).  You will be looking for elements in the HTML like

and

.   These IDs will be important in our javascript.

When a new scene loads, an event is fired and we can capture that with jQuery.  You’ll notice the first line in our code example is looking for “$(document).on('knack-scene-render.scene_3', …”  - This event will fire when our scene is rendered.  This is when we want to add the button to our view page.

To add the button to our view page, we’re going to use jQuery to create a new div container that will contain our button.  Then we will attach an event handler on the button that will use AJAX to send the data to our Formstack Documents contract.  Here’s what our code looks like:



As you’ll see in the code above, we add the link to our page, set an event handler that uses AJAX to send the contact data to Formstack Documents (using our Merge URL) and displays a message when complete.  This happens behind the scenes without ever having to leave Knack!

Here’s what the button looks like in action:
Â


Let’s click that button!  Everything worked great and here’s the document we have generated.  All of our data from Knack is in the document and it has been emailed off to the client.  How’s that for easy?
Â

Â
Wait, there’s more…

Generate and Download Merged Document

Creating a document behind the scenes is cool, but what if you want to open up the document right away without having to go to your email?  No problem, here is an updated code example that will generate a link that sends data to Formstack Documents in a new window rather than AJAX and then your document will be there for you

Use Repeatable/Loop Data

Do you have repeating data that is being printed into a table and you want those line items to come through to Formstack Documents? No problem! Check out the example code below:


Â

Automatically Generate Documents

If you’re looking to automatically generate documents every time a new record is added to your Knack application, you can automate the process by using Zapier.  Zapier will detect new records and send that new data over to Formstack Documents without anyone needing to click a button.  Setup is quite simple and all you need to do is map your Knack fields to the Formstack Documents fields and Zapier will handle the rest.

If you're looking for an easy way to build an online database application without the need for programming, you need to check out Knack.  With Knack you can get rid of those clunky spreadsheets and build easy to use web applications such as a custom CRM, proposal tracker, order management, and more.  Knack allows you to build some pretty powerful apps and we're going to show you how you can easily generate documents directly from Knack using Formstack Documents.

In this example, we’re going to show you how to generate a contract and send it to our customer directly from a Knack CRM application.  First, we’ll setup our contract template in Formstack Documents, then we’ll add a custom button to our Knack application that will send our client data to Formstack Documents to generate the contract.

For our contract, we’re going to use a Word document as the document type.  In the document we are going to add all of the normal contract terms, and then we’ll add the Formstack Documents merge fields (ie {$company_name}, {$address}, etc) where we want the Knack data to go.  Here’s what our contract template looks like:
Â


After we upload our document to Formstack Documents, we need to make sure we update the email delivery settings so that the contract is emailed to our client.  You can make these changes under the Deliver tab.  You’ll want to change the “To” address to the merge field for the email address.  If you don’t have an email address merge field setup yet, simply click the <> option and type in {$email}.  This will add “email” as a merge field.

On the Merge tab inside Formstack Documents, you’ll notice there is a “Merge URL” for your document.  This is the unique URL that you’ll use when sending data to Formstack Documents to populate your contract.  Save this for later.

Next, let’s jump into Knack and setup the custom button that will be used to generate a contract for a specific client.  The setup process is pretty straight forward, but it is a little technical.  We’ve tried to include as many examples as we could to help you, but Knack has a great support team that is more than happy to help with this custom coding.

We’re going to use Javascript to customize our Knack application to show a “Create Contract” button on our Client Detail page.  To edit the Javascript for our application, we’re going to go to the API & Code page in our application settings.  Once there, click the Javascript tab and you should see a code editor (text box).  This is where we are going to use jQuery to manipulate our page.
Â


We’re going to use this code snippet as a starting point for our application.  There are a few things that you need to figure out when setting up the javascript:

  1. Which “Scene” is your page in
  2. Which “View” in that scene is your page
  3. What the Field IDs are that you need to send to Formstack Documents

The easiest way to find this information is to “inspect” the HTML in your browser (either using the built-in development tools or using a plugin like Firebug).  You will be looking for elements in the HTML like

and

.   These IDs will be important in our javascript.

When a new scene loads, an event is fired and we can capture that with jQuery.  You’ll notice the first line in our code example is looking for “$(document).on('knack-scene-render.scene_3', …”  - This event will fire when our scene is rendered.  This is when we want to add the button to our view page.

To add the button to our view page, we’re going to use jQuery to create a new div container that will contain our button.  Then we will attach an event handler on the button that will use AJAX to send the data to our Formstack Documents contract.  Here’s what our code looks like:



As you’ll see in the code above, we add the link to our page, set an event handler that uses AJAX to send the contact data to Formstack Documents (using our Merge URL) and displays a message when complete.  This happens behind the scenes without ever having to leave Knack!

Here’s what the button looks like in action:
Â


Let’s click that button!  Everything worked great and here’s the document we have generated.  All of our data from Knack is in the document and it has been emailed off to the client.  How’s that for easy?
Â

Â
Wait, there’s more…

Generate and Download Merged Document

Creating a document behind the scenes is cool, but what if you want to open up the document right away without having to go to your email?  No problem, here is an updated code example that will generate a link that sends data to Formstack Documents in a new window rather than AJAX and then your document will be there for you

Use Repeatable/Loop Data

Do you have repeating data that is being printed into a table and you want those line items to come through to Formstack Documents? No problem! Check out the example code below:


Â

Automatically Generate Documents

If you’re looking to automatically generate documents every time a new record is added to your Knack application, you can automate the process by using Zapier.  Zapier will detect new records and send that new data over to Formstack Documents without anyone needing to click a button.  Setup is quite simple and all you need to do is map your Knack fields to the Formstack Documents fields and Zapier will handle the rest.

If you're looking for an easy way to build an online database application without the need for programming, you need to check out Knack.  With Knack you can get rid of those clunky spreadsheets and build easy to use web applications such as a custom CRM, proposal tracker, order management, and more.  Knack allows you to build some pretty powerful apps and we're going to show you how you can easily generate documents directly from Knack using Formstack Documents.

In this example, we’re going to show you how to generate a contract and send it to our customer directly from a Knack CRM application.  First, we’ll setup our contract template in Formstack Documents, then we’ll add a custom button to our Knack application that will send our client data to Formstack Documents to generate the contract.

For our contract, we’re going to use a Word document as the document type.  In the document we are going to add all of the normal contract terms, and then we’ll add the Formstack Documents merge fields (ie {$company_name}, {$address}, etc) where we want the Knack data to go.  Here’s what our contract template looks like:
Â


After we upload our document to Formstack Documents, we need to make sure we update the email delivery settings so that the contract is emailed to our client.  You can make these changes under the Deliver tab.  You’ll want to change the “To” address to the merge field for the email address.  If you don’t have an email address merge field setup yet, simply click the <> option and type in {$email}.  This will add “email” as a merge field.

On the Merge tab inside Formstack Documents, you’ll notice there is a “Merge URL” for your document.  This is the unique URL that you’ll use when sending data to Formstack Documents to populate your contract.  Save this for later.

Next, let’s jump into Knack and setup the custom button that will be used to generate a contract for a specific client.  The setup process is pretty straight forward, but it is a little technical.  We’ve tried to include as many examples as we could to help you, but Knack has a great support team that is more than happy to help with this custom coding.

We’re going to use Javascript to customize our Knack application to show a “Create Contract” button on our Client Detail page.  To edit the Javascript for our application, we’re going to go to the API & Code page in our application settings.  Once there, click the Javascript tab and you should see a code editor (text box).  This is where we are going to use jQuery to manipulate our page.
Â


We’re going to use this code snippet as a starting point for our application.  There are a few things that you need to figure out when setting up the javascript:

  1. Which “Scene” is your page in
  2. Which “View” in that scene is your page
  3. What the Field IDs are that you need to send to Formstack Documents

The easiest way to find this information is to “inspect” the HTML in your browser (either using the built-in development tools or using a plugin like Firebug).  You will be looking for elements in the HTML like

and

.   These IDs will be important in our javascript.

When a new scene loads, an event is fired and we can capture that with jQuery.  You’ll notice the first line in our code example is looking for “$(document).on('knack-scene-render.scene_3', …”  - This event will fire when our scene is rendered.  This is when we want to add the button to our view page.

To add the button to our view page, we’re going to use jQuery to create a new div container that will contain our button.  Then we will attach an event handler on the button that will use AJAX to send the data to our Formstack Documents contract.  Here’s what our code looks like:



As you’ll see in the code above, we add the link to our page, set an event handler that uses AJAX to send the contact data to Formstack Documents (using our Merge URL) and displays a message when complete.  This happens behind the scenes without ever having to leave Knack!

Here’s what the button looks like in action:
Â


Let’s click that button!  Everything worked great and here’s the document we have generated.  All of our data from Knack is in the document and it has been emailed off to the client.  How’s that for easy?
Â

Â
Wait, there’s more…

Generate and Download Merged Document

Creating a document behind the scenes is cool, but what if you want to open up the document right away without having to go to your email?  No problem, here is an updated code example that will generate a link that sends data to Formstack Documents in a new window rather than AJAX and then your document will be there for you

Use Repeatable/Loop Data

Do you have repeating data that is being printed into a table and you want those line items to come through to Formstack Documents? No problem! Check out the example code below:


Â

Automatically Generate Documents

If you’re looking to automatically generate documents every time a new record is added to your Knack application, you can automate the process by using Zapier.  Zapier will detect new records and send that new data over to Formstack Documents without anyone needing to click a button.  Setup is quite simple and all you need to do is map your Knack fields to the Formstack Documents fields and Zapier will handle the rest.

If you're looking for an easy way to build an online database application without the need for programming, you need to check out Knack.  With Knack you can get rid of those clunky spreadsheets and build easy to use web applications such as a custom CRM, proposal tracker, order management, and more.  Knack allows you to build some pretty powerful apps and we're going to show you how you can easily generate documents directly from Knack using Formstack Documents.

In this example, we’re going to show you how to generate a contract and send it to our customer directly from a Knack CRM application.  First, we’ll setup our contract template in Formstack Documents, then we’ll add a custom button to our Knack application that will send our client data to Formstack Documents to generate the contract.

For our contract, we’re going to use a Word document as the document type.  In the document we are going to add all of the normal contract terms, and then we’ll add the Formstack Documents merge fields (ie {$company_name}, {$address}, etc) where we want the Knack data to go.  Here’s what our contract template looks like:
Â


After we upload our document to Formstack Documents, we need to make sure we update the email delivery settings so that the contract is emailed to our client.  You can make these changes under the Deliver tab.  You’ll want to change the “To” address to the merge field for the email address.  If you don’t have an email address merge field setup yet, simply click the <> option and type in {$email}.  This will add “email” as a merge field.

On the Merge tab inside Formstack Documents, you’ll notice there is a “Merge URL” for your document.  This is the unique URL that you’ll use when sending data to Formstack Documents to populate your contract.  Save this for later.

Next, let’s jump into Knack and setup the custom button that will be used to generate a contract for a specific client.  The setup process is pretty straight forward, but it is a little technical.  We’ve tried to include as many examples as we could to help you, but Knack has a great support team that is more than happy to help with this custom coding.

We’re going to use Javascript to customize our Knack application to show a “Create Contract” button on our Client Detail page.  To edit the Javascript for our application, we’re going to go to the API & Code page in our application settings.  Once there, click the Javascript tab and you should see a code editor (text box).  This is where we are going to use jQuery to manipulate our page.
Â


We’re going to use this code snippet as a starting point for our application.  There are a few things that you need to figure out when setting up the javascript:

  1. Which “Scene” is your page in
  2. Which “View” in that scene is your page
  3. What the Field IDs are that you need to send to Formstack Documents

The easiest way to find this information is to “inspect” the HTML in your browser (either using the built-in development tools or using a plugin like Firebug).  You will be looking for elements in the HTML like

and

.   These IDs will be important in our javascript.

When a new scene loads, an event is fired and we can capture that with jQuery.  You’ll notice the first line in our code example is looking for “$(document).on('knack-scene-render.scene_3', …”  - This event will fire when our scene is rendered.  This is when we want to add the button to our view page.

To add the button to our view page, we’re going to use jQuery to create a new div container that will contain our button.  Then we will attach an event handler on the button that will use AJAX to send the data to our Formstack Documents contract.  Here’s what our code looks like:



As you’ll see in the code above, we add the link to our page, set an event handler that uses AJAX to send the contact data to Formstack Documents (using our Merge URL) and displays a message when complete.  This happens behind the scenes without ever having to leave Knack!

Here’s what the button looks like in action:
Â


Let’s click that button!  Everything worked great and here’s the document we have generated.  All of our data from Knack is in the document and it has been emailed off to the client.  How’s that for easy?
Â

Â
Wait, there’s more…

Generate and Download Merged Document

Creating a document behind the scenes is cool, but what if you want to open up the document right away without having to go to your email?  No problem, here is an updated code example that will generate a link that sends data to Formstack Documents in a new window rather than AJAX and then your document will be there for you

Use Repeatable/Loop Data

Do you have repeating data that is being printed into a table and you want those line items to come through to Formstack Documents? No problem! Check out the example code below:


Â

Automatically Generate Documents

If you’re looking to automatically generate documents every time a new record is added to your Knack application, you can automate the process by using Zapier.  Zapier will detect new records and send that new data over to Formstack Documents without anyone needing to click a button.  Setup is quite simple and all you need to do is map your Knack fields to the Formstack Documents fields and Zapier will handle the rest.

If you're looking for an easy way to build an online database application without the need for programming, you need to check out Knack.  With Knack you can get rid of those clunky spreadsheets and build easy to use web applications such as a custom CRM, proposal tracker, order management, and more.  Knack allows you to build some pretty powerful apps and we're going to show you how you can easily generate documents directly from Knack using Formstack Documents.

In this example, we’re going to show you how to generate a contract and send it to our customer directly from a Knack CRM application.  First, we’ll setup our contract template in Formstack Documents, then we’ll add a custom button to our Knack application that will send our client data to Formstack Documents to generate the contract.

For our contract, we’re going to use a Word document as the document type.  In the document we are going to add all of the normal contract terms, and then we’ll add the Formstack Documents merge fields (ie {$company_name}, {$address}, etc) where we want the Knack data to go.  Here’s what our contract template looks like:
Â


After we upload our document to Formstack Documents, we need to make sure we update the email delivery settings so that the contract is emailed to our client.  You can make these changes under the Deliver tab.  You’ll want to change the “To” address to the merge field for the email address.  If you don’t have an email address merge field setup yet, simply click the <> option and type in {$email}.  This will add “email” as a merge field.

On the Merge tab inside Formstack Documents, you’ll notice there is a “Merge URL” for your document.  This is the unique URL that you’ll use when sending data to Formstack Documents to populate your contract.  Save this for later.

Next, let’s jump into Knack and setup the custom button that will be used to generate a contract for a specific client.  The setup process is pretty straight forward, but it is a little technical.  We’ve tried to include as many examples as we could to help you, but Knack has a great support team that is more than happy to help with this custom coding.

We’re going to use Javascript to customize our Knack application to show a “Create Contract” button on our Client Detail page.  To edit the Javascript for our application, we’re going to go to the API & Code page in our application settings.  Once there, click the Javascript tab and you should see a code editor (text box).  This is where we are going to use jQuery to manipulate our page.
Â


We’re going to use this code snippet as a starting point for our application.  There are a few things that you need to figure out when setting up the javascript:

  1. Which “Scene” is your page in
  2. Which “View” in that scene is your page
  3. What the Field IDs are that you need to send to Formstack Documents

The easiest way to find this information is to “inspect” the HTML in your browser (either using the built-in development tools or using a plugin like Firebug).  You will be looking for elements in the HTML like

and

.   These IDs will be important in our javascript.

When a new scene loads, an event is fired and we can capture that with jQuery.  You’ll notice the first line in our code example is looking for “$(document).on('knack-scene-render.scene_3', …”  - This event will fire when our scene is rendered.  This is when we want to add the button to our view page.

To add the button to our view page, we’re going to use jQuery to create a new div container that will contain our button.  Then we will attach an event handler on the button that will use AJAX to send the data to our Formstack Documents contract.  Here’s what our code looks like:



As you’ll see in the code above, we add the link to our page, set an event handler that uses AJAX to send the contact data to Formstack Documents (using our Merge URL) and displays a message when complete.  This happens behind the scenes without ever having to leave Knack!

Here’s what the button looks like in action:
Â


Let’s click that button!  Everything worked great and here’s the document we have generated.  All of our data from Knack is in the document and it has been emailed off to the client.  How’s that for easy?
Â

Â
Wait, there’s more…

Generate and Download Merged Document

Creating a document behind the scenes is cool, but what if you want to open up the document right away without having to go to your email?  No problem, here is an updated code example that will generate a link that sends data to Formstack Documents in a new window rather than AJAX and then your document will be there for you

Use Repeatable/Loop Data

Do you have repeating data that is being printed into a table and you want those line items to come through to Formstack Documents? No problem! Check out the example code below:


Â

Automatically Generate Documents

If you’re looking to automatically generate documents every time a new record is added to your Knack application, you can automate the process by using Zapier.  Zapier will detect new records and send that new data over to Formstack Documents without anyone needing to click a button.  Setup is quite simple and all you need to do is map your Knack fields to the Formstack Documents fields and Zapier will handle the rest.

Formstack
Formstack is a SaaS company with a mission to help organizations digitize what matters, automate workflows, and fix processes—all without code. A variety of team members come together to compile posts under Formstack's authorship.
More Articles
Meet The Host
CEO of
Connect
Chris is on a mission to turn people into great leaders. He's passionate about helping problem solvers see more value in the work they do every day.