Introduction
Using the Gravity Forms Webhooks Add-On it is possible to populate WebMerge documents when a form is submitted.
Note: This article assumes you have installed and activated the Webhooks Add-On and have created a document in your WebMerge account. If not, you will need to do so before any of the functionality in this article can be used.
Configuring the Webhook
To configure webhooks for a form go to your Form Settings and click on the Webhooks tab and then click the Add New button.
Next, you’ll need to configure the request that is being made.
Name
Enter a name for your feed. This can be anything you want as it is only used for identification purposes on the feeds list page and in the add-on log.
Request URL
Enter the Merge URL from your WebMerge documents Merge tab. e.g. https://www.webmerge.me/merge/12345/abcde
When performing a test request append the test=1 query string parameter to the URL so the merge does not count against your accounts merge credits e.g. https://www.webmerge.me/merge/12345/abcde?test=1
Request Method
Select the POST choice as the request method.
Request Format
Select the JSON choice as the request format.
Request Headers
There are no request headers to configure when integrating with WebMerge.
Request Body
Select the Select Fields choice.
Field Values
Configure rows for each of your documents merge fields. Click the add item icon (+) to add new rows.
You can find the keys to use on your WebMerge documents Test tab, they are the labels above each test value input, ignoring the JSON merge field at the end.
For the values you can select from the form fields, entry meta, or Add Custom Value which will display a text input which also supports Merge Tags.
Webhook Condition
If WebMerge document population should be conditional based on the value of a form field select the Enable Condition checkbox and then configure the rules which should be met for this request to be sent.
Alternative Method
If you don’t have an Elite or legacy Developer license and would prefer not to upgrade your existing license, you can still populate WebMerge documents by using one of the following methods:
- Pro license holders can use the Zapier Add-On. See the WebMerge Gravity Forms support article for an example.
- Anyone can use the gform_after_submission filter in the theme functions.php file or a custom functionality plugin. See the Populate a Living Will from Gravity Forms article by WebMerge for more details.