Hi everyone,
I’m sending Gravity Forms submission data via a custom webhook to Airtable using gform_after_submission.
Everything works perfectly for simple fields, but Name, Address, and other compound fields are not sending their individual parts (First & Last for Name; Street Address, City, State, ZIP for Address) — they are missing entirely on the Airtable side.
Here’s my current code (Form ID 41) that I believed should work — it loops through $field->inputs and tries to pull every possible label source:
add_action( 'gform_after_submission_41', 'savemyfurbaby_form41_to_airtable', 10, 2 );
function savemyfurbaby_form41_to_airtable( $entry, $form ) {
// ... page restriction and webhook URL ...
$payload = new stdClass();
foreach ( $form['fields'] as $field ) {
if ( $field->is_administrative || $field->visibility === 'hidden' ) continue;
// COMPOUND FIELDS
if ( ! empty( $field->inputs ) && is_array( $field->inputs ) ) {
foreach ( $field->inputs as $input ) {
if ( ! empty( $input['isHidden'] ) ) continue;
$input_id = (string) $input['id'];
$value = rgar( $entry, $input_id );
$label = '';
if ( ! empty( $input['customLabel'] ) ) $label = $input['customLabel'];
elseif ( ! empty( $input['label'] ) ) $label = $input['label'];
elseif ( ! empty( $input['placeholder'] ) ) $label = $input['placeholder'];
else $label = 'Field ' . $input_id;
$label = trim( $label );
$safe_label = str_replace( [ '"', '\\', ':' ], '', $label );
$payload->$safe_label = (string) $value;
}
continue;
}
// REGULAR FIELDS
$label = trim( GFCommon::get_label( $field ) );
$value = rgar( $entry, (string) $field->id );
// ... handle arrays, etc. ...
$safe_label = str_replace( [ '"', '\\' ], '', $label );
$payload->$safe_label = (string) ( $value ?? '' );
}
// ... meta fields and wp_remote_post() ...
}
Despite this, First Name, Last Name, Street Address, City, State, ZIP, etc. are still not appearing in the webhook payload.
Big Question is :
- Is $field->inputs + checking customLabel / label / placeholder still the correct and reliable way in Gravity Forms?
I’d really appreciate an example of how to extract every individual part of Name and Address fields (with correct human-readable labels) inside gform_after_submission.
Thank you in advance!