Mappings for Wealthbox documentation
Everything you need to install the plugin, connect Wealthbox, map your Gravity Forms and extend it with code.
Introduction
Mappings for Wealthbox sends every Gravity Forms submission straight into Wealthbox CRM as a contact, with no Zapier, no CSV exports and no copy and paste. You pick a form, choose which Wealthbox field each form field goes to, and publish. From then on, each submission creates the contact in Wealthbox within seconds.
It is built for financial advisors, RIAs and the agencies that run their websites: firms that capture leads on WordPress and live in Wealthbox. The plugin comes in two parts:
- Mappings for Wealthbox (free) creates new contacts from any Gravity Form using the standard Wealthbox contact fields.
- Mappings for Wealthbox Pro ($49, one time, one site) is an add-on that installs next to the free plugin. It adds custom fields, updating existing contacts, sync logs and GP Nested Forms support.
See the Free vs Pro comparison for the full list.
Requirements and installation
| Requirement | Minimum |
|---|---|
| WordPress | 6.0 |
| PHP | 8.0 |
| Gravity Forms | Active |
| Wealthbox | An API access token |
| GP Nested Forms (Pro, optional) | Active, only if you map nested fields |
Install the free plugin
- In WordPress go to Plugins › Add New › Upload Plugin.
- Upload
mappings-for-wealthbox.zipand click Install Now. - Click Activate. A new Wealthbox menu appears in the admin sidebar.
Install Pro
- Make sure the free plugin is installed and active. Pro is an add-on and will not run without it.
- Upload
mappings-for-wealthbox-pro.zipthe same way and activate it. - Pro creates two database tables on activation, for the contact index and the sync logs. A Logs item appears under the Wealthbox menu.
If the free plugin is missing, Pro shows a notice asking you to install and activate it, and does nothing else.
Connecting to Wealthbox
The plugin talks to Wealthbox with one access token, saved under Wealthbox › Settings. The page has two tabs: General and Connection & Cache.
Get your access token
- Log in to Wealthbox and open Settings › API Access.
- Create a token and copy it.
General tab
| Setting | What it does | Default |
|---|---|---|
| Access token | Sent with every request as the ACCESS_TOKEN header. Stored in a password field. | Empty |
| Base URL | The Wealthbox API address. Leave it unless Wealthbox tells you otherwise. | https://api.crmworkspace.com/v1 |
| Document types (Pro) | Which Wealthbox record types to load custom fields for: Contact, Opportunity, Project. | Contact |
Paste the token, check the base URL and click Save Changes.
Connection & Cache tab
- Test connection sends one request to Wealthbox. You see a success message when it works, "Authentication failed (HTTP 401 or 403)" for a bad token, or the HTTP error for anything else. Save the token before you test.
- Custom field cache (Pro) shows how many custom fields are cached. It refreshes on its own every 3 hours. Click Clear cache & re-fetch fields after adding or renaming a custom field in Wealthbox.
Requests time out after 20 seconds.
Creating a mapping
A mapping links one Gravity Form to Wealthbox. It is saved under Wealthbox › Mappings and only runs once it is published.
- Go to Wealthbox › Mappings › Add New.
- Give it a title you will recognise, for example "Contact page form".
- Choose the form under Gravity Form. The field table loads straight away.
- (Pro) Choose the Action and, for update modes, the Match using field.
- For each row, pick the Wealthbox field in the right column. Leave a row on Not mapped to skip it. The dropdowns are searchable.
- Click Publish.
The field table
- The left column lists every form field with its Gravity Forms key, for example
1.3. - Fields with several inputs (Name, Address) appear once as the whole value, then once per sub input such as "Name, First" or "Address, City".
- Checkbox and Multi Select fields appear once. All selected choices are sent together.
- Page breaks, sections, HTML blocks and CAPTCHA are left out.
- Nested Forms child fields carry a nested tag (Pro).
Hidden fields
Hidden Gravity Forms fields such as user ID, UTM tags or tracking values are hidden from the table by default. Tick Show hidden fields to map them.
Duplicate a mapping
Hover a mapping in the list and click Duplicate. You get a draft copy with the same form, action, match settings and field map.
One mapping per form
If more than one published mapping points to the same form, only the most recently published one runs. Keep the others as drafts. The Mappings list has a sortable Gravity Form column so you can see which form each mapping uses.
Wealthbox fields and value formatting
The free plugin maps to nine standard Wealthbox contact fields. Pro adds every custom field you have in Wealthbox.
| Dropdown label | Sent to Wealthbox as | Notes |
|---|---|---|
| First name | first_name | |
| Last name | last_name | |
| Middle name | middle_name | |
| Nickname | nickname | |
| Job title | job_title | |
| Company name | company_name | |
| Email address | email_addresses item | Kind Personal |
| Phone number | phone_numbers item | Kind Personal |
| Background information | background_info | Good for messages and notes |
If no first or last name is mapped or filled in, the contact is saved as Web Lead, because Wealthbox needs a name.
How Gravity Forms values are sent
| Gravity Forms field | What Wealthbox receives |
|---|---|
| Text, email, phone, dropdown and similar | The value as submitted |
| File Upload, single | The file URL |
| File Upload, multiple | One URL per line |
| Checkbox | Each ticked choice on its own line |
| Multi Select | Each selected choice on its own line |
| Consent | "Consent given" or "Consent NOT given", then the full consent text |
| Empty field | Nothing is sent for that field |
If you map a single sub input (for example only the consent checkbox 5.1), the raw value of that input is sent instead.
Pro: sync actions and contact matching
Pro lets each mapping decide what happens when someone already in Wealthbox submits the form again. Pick it under Action on the mapping screen.
| Action | Match found | No match found | Log status |
|---|---|---|---|
| Create contact only | A new contact is created anyway | A new contact is created | created |
| Update contact only | That contact is updated | Nothing is sent | updated or skipped |
| Create and update | That contact is updated | A new contact is created | updated or created |
The free plugin always uses Create contact only. If you deactivate Pro, mappings set to an update action are skipped, not turned into creates, until Pro is active again.
Match using
- The form field that holds the value, for example your Email field.
- The type, Email or Phone. Emails are trimmed and lowercased. Phone numbers keep only their digits, so "(555) 010-2233" and "5550102233" match.
How the match works
Each time the plugin creates or updates a contact, it saves a SHA-256 fingerprint of that contact's email and phone, with the Wealthbox contact ID, in its own index table. The real email and phone are never stored there. On the next submission it fingerprints the match value and looks it up: one database lookup, no API call.
The index only knows contacts the plugin itself created or updated. A contact already in Wealthbox before you installed Pro is not found yet, so Create and update makes a second record for that person. Matching existing Wealthbox contacts is planned for an update.
Pro: custom fields
With Pro active, every Wealthbox contact custom field appears in the mapping dropdown under Custom fields, below the native fields.
Auto matching
When you load a form, Pro pre-selects a custom field for any form field whose label matches the custom field's name, ignoring capitals and extra spaces. "Annual Income" in Gravity Forms matches "annual income" in Wealthbox. Check the suggestions before you publish. A saved choice always wins.
Name, email and phone in custom fields
If you map a Gravity Forms Email, Phone or Name field to a custom field, Pro also fills the matching native field, so the contact always gets a real name, email and phone:
- Email field: also added as the contact's email address
- Phone field: also added as the contact's phone number
- Name, First (
x.3): also set as first name - Name, Last (
x.6): also set as last name
The cache
Custom field definitions are fetched 100 at a time for each document type you selected in Settings, up to 5,000 fields, and cached for 3 hours so the mapping screen never waits on the API. An empty cache refills itself on the next page load. Only Contact custom fields appear in the mapping dropdown today.
Pro: GP Nested Forms
Pro lets you map the fields inside a Gravity Perks Nested Forms field, for example several addresses, dependents or accounts entered on one form. Each child field appears as its own row, labelled "Parent field → Child field", with a key like nested:12:3 (parent field 12, child field 3).
At submission, every child entry becomes one numbered line, labelled with the child field's name:
Address-1: 12 High St, Porto, 4000-123, Portugal
Address-2: 8 Rua Nova, Gaia, 4400-001, Portugal
- Map the whole child field to get all its parts joined with commas, as above.
- Map one sub input (
nested:12:3.3) to get only that part per line. - Send nested rows to a text custom field or to Background information, because the result is several lines long.
- Nested rows cannot be the Match using field.
Pro: sync logs
Every submission on a mapped form writes one row to Wealthbox › Logs, so you can see exactly what was sent and what Wealthbox answered.
| Column | Shows |
|---|---|
| Time (UTC) | When the sync ran |
| Form / Entry | Gravity Forms form and entry IDs |
| Action | create, update or upsert |
| Status | created, updated, skipped or error, colour coded |
| HTTP | The response code from Wealthbox, 0 if the request never reached it |
| Contact ID | The Wealthbox contact ID, when there is one |
| Details | The message, the full request payload and the full response body |
Sort by time, form, entry, status or HTTP code, filter by a From and To date, and set rows per page under Screen Options. Logs hold submitted form data, so treat them as personal data. They are kept until you uninstall Pro; automatic clean up is planned for an update.
Developer reference
The free plugin is a small engine with hooks. Pro is built entirely on those same hooks, so you can extend it the same way.
Free plugin hooks
| Hook | Type | Use it to |
|---|---|---|
wbm_request_args | filter | Change HTTP args (timeout, headers, retries) |
wbm_contact_kind | filter | Change the email and phone kind (default Personal) |
wbm_contact_payload | filter | Edit the contact payload before it is sent |
wbm_native_fields | filter | Add native fields to the dropdown |
wbm_resource | filter | Swap the resource handler |
wbm_before_sync | action | Inspect the payload before the API call |
wbm_after_sync | action | React after the sync |
wbm_run_action | filter | Handle actions other than create |
wbm_target_groups | filter | Add groups to the Wealthbox field dropdown |
wbm_suggest_target | filter | Pre-select a target for a form field |
wbm_map_target | filter | Handle targets that are not native fields |
wbm_form_field_rows | filter | Add rows for a Nested Forms field |
wbm_nested_value | filter | Resolve a nested key to a value |
wbm_metabox_rows | action | Add rows to the mapping screen |
wbm_save_mapping | action | Save those rows |
wbm_settings_general_rows | action | Add rows to the General settings tab |
wbm_settings_tools_sections | action | Add sections to the Connection tab |
wbm_sanitize_settings | filter | Save extra settings keys |
Pro hooks
| Hook | Type | Use it to |
|---|---|---|
wbm_custom_fields | filter | Edit the custom field list before it is cached |
wbm_use_api_lookup_fallback | filter | Turn on the API lookup when the index misses (off by default, experimental) |
wbm_native_role | filter | Route a custom field mapping to first name, last name, email or phone |
wbm_nested_line_format | filter | Change one line of nested output |
Example: tag every web lead
add_filter( 'wbm_contact_payload', function ( $payload, $entry, $form ) {
$payload['tags'] = [ 'Website lead' ];
return $payload;
}, 10, 3 );
Where data is stored
| Item | Location | Owner |
|---|---|---|
| Settings | Option wbm_settings | Free |
| Mappings | Post type wbm_mapping and its _wbm_* meta | Free |
| Contact index | Table {prefix}wb_contact_index | Pro |
| Sync logs | Table {prefix}wb_logs | Pro |
| Custom field cache | Transient wbm_custom_fields, 3 hours | Pro |
The code uses the MappingsForWealthbox namespace (Pro: MappingsForWealthbox\Pro). The Wealthbox_Resource interface means support for more Wealthbox record types can be added as new classes, without changing the sync engine.
Deactivating and uninstalling
Deactivating never deletes anything. Deleting a plugin removes only that plugin's own data, and nothing in Wealthbox is ever deleted.
| You do this | What happens |
|---|---|
| Deactivate Pro | Mappings, logs and the index stay. Create mappings keep working. Update mappings are skipped until Pro is back. |
| Delete Pro | Drops the index and log tables and the custom field cache. Mappings and settings stay. |
| Deactivate free | Nothing is synced. Pro stops too and shows a notice. |
| Delete free | Deletes the settings (your token) and every mapping. |
Troubleshooting and FAQ
| Problem | Likely cause | Fix |
|---|---|---|
| Test connection says authentication failed | Wrong or expired token | Create a new token, paste it, save, test again |
| "Add a token and base URL first" | Settings not saved | Save before testing |
| No contact appears in Wealthbox | Mapping is a draft or points to another form | Publish it and check the Gravity Form column |
| Contact is called "Web Lead" | No first or last name mapped or filled in | Map Name, First and Name, Last |
| Custom fields missing (Pro) | Cache built before the token, or a new field | Clear cache & re-fetch fields |
| Update only does nothing (Pro) | No match in the index, log shows skipped | Use Create and update, or check Match using |
| Log shows error, HTTP 0 | Request never reached Wealthbox | Check the server can reach the base URL |
| Log shows error, HTTP 422 | Wealthbox rejected a value | Read the response body in Details |
Known limitations
- Update modes only find contacts the plugin created or updated itself.
- Logs are not cleaned up automatically.
- Only one published mapping per form is used.
- Only Wealthbox Contacts are supported today.
Questions the docs do not answer? Contact me.
Changelog and credits
| Version | Plugin | Changes |
|---|---|---|
| 1.0.0 | Free | First release: native field mapping, create only sync, value formatting, duplicate mapping, test connection |
| 1.0.0 | Pro | First release: custom fields with auto matching, update and create and update, contact index, sync logs, GP Nested Forms |
Built by Samama Tahir. Licensed under GPL v2 or later. Wealthbox is a trademark of its owner and Gravity Forms is a trademark of Rocketgenius. This plugin is independent and not affiliated with either.