Documentation · Version 1.0.0

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 into Wealthbox CRM as a contact. You don't need Zapier, CSV exports or copy and paste. You pick a form, choose the Wealthbox field for each form field, and publish. From then on, each submission creates a 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 work 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 installed alongside the free plugin. It adds custom fields, updates to existing contacts, sync logs and GP Nested Forms support.

See the Free vs Pro comparison for the full list.

Requirements and installation

RequirementMinimum
WordPress6.0
PHP8.0
Gravity FormsActive
WealthboxAn API access token
GP Nested Forms (Pro, optional)Active, only if you map nested fields

Install the free plugin

  1. Download the free plugin.
  2. In WordPress, go to Plugins › Add New › Upload Plugin.
  3. Upload mappings-for-wealthbox.zip and click Install Now.
  4. Click Activate. A new Wealthbox menu appears in the admin sidebar.

Install Pro

  1. Make sure the free plugin is installed and active. Pro is an add-on and doesn't run without it.
  2. Upload mappings-for-wealthbox-pro.zip (you get it after buying Pro) the same way, and activate it.
  3. On activation, Pro creates two database tables: one for the contact index and one for 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 connects to Wealthbox with one access token, saved under Wealthbox › Settings. The page has two tabs: General and Connection & Cache.

Get your access token

  1. Log in to Wealthbox and open Settings › API Access.
  2. Create a token and copy it.

General tab

SettingWhat it doesDefault
Access tokenSent with every request as the ACCESS_TOKEN header. Stored in a password field.Empty
Base URLThe 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 automatically every 3 hours. Click Clear cache & re-fetch fields after you add or rename a custom field in Wealthbox.

Requests time out after 20 seconds.

Creating a mapping

A mapping links one Gravity Form to Wealthbox. Mappings are saved under Wealthbox › Mappings and only run once published.

  1. Go to Wealthbox › Mappings › Add New.
  2. Give it a title you'll recognize, for example “Contact page form”.
  3. Choose the form under Gravity Form. The field table loads immediately.
  4. (Pro) Choose the Action and, for update modes, the Match using field.
  5. For each row, pick the Wealthbox field in the right column. Leave a row on Not mapped to skip it. The dropdowns are searchable.
  6. 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 fields 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 over 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 in your Wealthbox account.

Dropdown labelSent to Wealthbox asNotes
First namefirst_name
Last namelast_name
Middle namemiddle_name
Nicknamenickname
Job titlejob_title
Company namecompany_name
Email addressemail_addresses itemKind Personal
Phone numberphone_numbers itemKind Personal
Background informationbackground_infoGood for messages and notes

If no first or last name is mapped or filled in, the contact is saved as Web Lead, because Wealthbox requires a name.

How Gravity Forms values are sent

Gravity Forms fieldWhat Wealthbox receives
Text, email, phone, dropdown and similarThe value as submitted
File Upload, singleThe file URL
File Upload, multipleOne URL per line
CheckboxEach ticked choice on its own line
Multi SelectEach selected choice on its own line
Consent“Consent given” or “Consent NOT given”, followed by the full consent text
Empty fieldNothing 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

With Pro, each mapping decides what happens when someone already in Wealthbox submits the form again. Choose it under Action on the mapping screen.

ActionMatch foundNo match foundLog status
Create contact onlyA new contact is created anywayA new contact is createdcreated
Update contact onlyThat contact is updatedNothing is sentupdated or skipped
Create and updateThat contact is updatedA new contact is createdupdated 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 query, no API call.

The index only knows contacts the plugin itself created or updated. A contact that was in Wealthbox before you installed Pro isn't found yet, so Create and update makes a second record for that person. Matching existing Wealthbox contacts is planned for a future update.

Pro Custom fields

With Pro active, every Wealthbox contact custom field appears in the mapping dropdown under Custom fields, below the standard 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 choice you've saved always takes priority.

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 standard 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 the first name
  • Name, Last (x.6): also set as the last name

The cache

Custom field definitions are fetched 100 at a time for each document type 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 can 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).

On submission, every child entry becomes one numbered line, labelled with the child field's name:

Address-1: 120 Main St, Austin, TX 78701, United States
Address-2: 45 Oak Ave, Denver, CO 80203, United States
  • 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 on each line.
  • Send nested rows to a text custom field or to Background information, because the result spans several lines.
  • Nested rows can't be used as 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 how Wealthbox responded.

ColumnShows
Time (UTC)When the sync ran
Form / EntryGravity Forms form and entry IDs
Actioncreate, update or upsert
Statuscreated, updated, skipped or error, color coded
HTTPThe response code from Wealthbox, or 0 if the request never reached it
Contact IDThe Wealthbox contact ID, when there is one
DetailsThe 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 contain submitted form data, so treat them as personal data. They are kept until you uninstall Pro; automatic cleanup is planned for a future update.

Developer reference

The free plugin is a small engine with hooks. Pro is built entirely on those same hooks, so you can extend the plugin the same way.

Free plugin hooks

HookTypeUse it to
wbm_request_argsfilterChange HTTP args (timeout, headers, retries)
wbm_contact_kindfilterChange the email and phone kind (default Personal)
wbm_contact_payloadfilterEdit the contact payload before it is sent
wbm_native_fieldsfilterAdd native fields to the dropdown
wbm_resourcefilterSwap the resource handler
wbm_before_syncactionInspect the payload before the API call
wbm_after_syncactionReact after the sync
wbm_run_actionfilterHandle actions other than create
wbm_target_groupsfilterAdd groups to the Wealthbox field dropdown
wbm_suggest_targetfilterPre-select a target for a form field
wbm_map_targetfilterHandle targets that are not native fields
wbm_form_field_rowsfilterAdd rows for a Nested Forms field
wbm_nested_valuefilterResolve a nested key to a value
wbm_metabox_rowsactionAdd rows to the mapping screen
wbm_save_mappingactionSave those rows
wbm_settings_general_rowsactionAdd rows to the General settings tab
wbm_settings_tools_sectionsactionAdd sections to the Connection tab
wbm_sanitize_settingsfilterSave extra settings keys

Pro hooks

HookTypeUse it to
wbm_custom_fieldsfilterEdit the custom field list before it is cached
wbm_use_api_lookup_fallbackfilterUse an API lookup when the index has no match (off by default, experimental)
wbm_native_rolefilterSend a custom field mapping to first name, last name, email or phone as well
wbm_nested_line_formatfilterChange 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

ItemLocationPlugin
SettingsOption wbm_settingsFree
MappingsPost type wbm_mapping and its _wbm_* metaFree
Contact indexTable {prefix}wb_contact_indexPro
Sync logsTable {prefix}wb_logsPro
Custom field cacheTransient wbm_custom_fields, 3 hoursPro

The code uses the MappingsForWealthbox namespace (Pro: MappingsForWealthbox\Pro). Because of the Wealthbox_Resource interface, 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 thisWhat happens
Deactivate ProMappings, logs and the index stay. Create mappings keep working. Update mappings are skipped until Pro is active again.
Delete ProDrops the index and log tables and the custom field cache. Mappings and settings stay.
Deactivate freeNothing is synced. Pro stops too and shows a notice.
Delete freeDeletes the settings (including your token) and every mapping.

Troubleshooting

ProblemLikely causeFix
Test connection says authentication failedWrong or expired tokenCreate a new token, paste it, save and test again
“Add a token and base URL first”Settings not savedSave before testing
No contact appears in WealthboxThe mapping is a draft or points to another formPublish it and check the Gravity Form column
Contact is called “Web Lead”No first or last name mapped or filled inMap Name, First and Name, Last
Custom fields missing (Pro)Cache built before the token was saved, or a new fieldClick Clear cache & re-fetch fields
Update only does nothing (Pro)No match in the index; the log shows skippedUse Create and update, or check Match using
Log shows error, HTTP 0The request never reached WealthboxCheck that the server can reach the base URL
Log shows error, HTTP 422Wealthbox rejected a valueRead the response body under 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.

Have a question the docs don't answer? Contact us.

Changelog

VersionPluginChanges
1.0.0FreeFirst release: standard field mapping, create-only sync, value formatting, mapping duplication, connection test
1.0.0ProFirst release: custom fields with auto matching, update and create-and-update, contact index, sync logs, GP Nested Forms

Built by Metafoid. 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.