Gravity Forms

This page documents Gravity Forms and the Nationbuilder integration.

This documentation compliments the offical Gravity Forms Documentation. The aim of this page is to provide the additional information to configure the For Purpose Nationbuilder integration.

Note this page does not cover the donation form, for that please see the donation form documentation.

#Summary

Gravity Forms Menu

You will see a new Forms menu in the Wordpress admin sidebar.

This menu is where the forms are created and configured.

Creating a Form

However it is recommended to duplicate an existing similar form, if that is possible.

You may then need to edit the form fields. Please refer to the Gravity Form Editor Documentation for detailed information on form editing.

There are a few points to note when creating the form fields:

Accesing the Nationbuilder Webhooks Integration

A Nationbuilder Integration must be configured for each form. This is done using the Gravity Forms Webhook Add On.

You access the Webhook configuration by hovering over the desired form and then hovering over the pop up Settings menu. You should see a second submenu pop up with a Webhooks menu option. Either click on this, or you can click Settings to go to the settings page, then Webhooks in the side menu.

Configuring the Webhooks Integration

For an overview of the configuration it is recommended to read the offical Gravity Forms Webhook Documentation.

If you have copied an existing form, the fields should already be prefilled. You will just need to tweak the settings for your form.

These are a description of the fields and values you will need to use.

Name

Nationbuilder Integration (recommended)

This is the name of this Webhook (it is possible to configure multiple webhooks for a form). You can pick any name, we recommend something like the above.

Request URL

https://ecpat-api-612dc6efdc5a.herokuapp.com/people-upsert-form

This is the web address of the For Purpose Nationbuilder integration. It must be set to exactly the above address.

Request Method

POST (leave as is)

Request Format

JSON (leave as is)

Request Headers

Authorization : Bearer SECRET_TOKEN

This value stores a secret token that the For Purpose Integration checks to ensure ECPAT is sending the request. There are two settings: in the left dropdown select Authorization. In the right textbox add the text Bearer SECRET_TOKEN, except SECRET_TOKEN must be the real secret token. You can copy the secret token from another webhook configuration, or you will need to contact ECPAT or For Purpose to get this value.

Request Body

Pick Select Fields. This is required to configure how the feilds are sent to the Nationbuilder integration.

You will then need to pick the form fields to send. The following describes how to send specific fields to the Nationbuilder integration.

Select your email form field in the dropdown. This field is required for the Nationbuilder integration to work. Users are identified by email in Nationbuilder. The integration will look up the user by email. If they exist in Nationbuilder the user will be updated, else a new user with that email will be created.

Select your first name form field in the dropdown.

Select your last name form field in the dropdown.

Select Address (Country). In Nationbuilder, this will set the users Home Address Country. You can replace it with work_address.country_code or mailing_address.country_code if you wish to change the address type. Note that country_code is used - Nationbuilder expects a country code, but the integration will automatically convert country names into country codes.

Pick your Organisation or Employer form field in the dropdown. This value is stored in the Employer field in Nationbuilder.

Pick your Role or Occupation form field in the dropdown. This value is stored in the Occupation field in Nationbuilder.

This is a special key that will Tag the User in Nationbuilder with the form value. You might also want to set an explict tag here, for example to tag all users who submit this form Requested Contact. To do this, select Add Custom Value in the Value dropdown (at the bottom of the list of options). You can then enter the specific text you wish to tag the user with. You may add multiple fields with the tag keyword to add multiple tags.

Updating Other Nationbuilder Fields

The integration can update any person field in Nationbuilder (that is text or numeric). For a full list of possible fields, please see this People API Reference Document.