# Webhook Send Admin Field Label \[RESOLVED\]

**URL:** <https://community.gravityforms.com/t/webhook-send-admin-field-label-resolved/12148>\
**Category:** Get Help\
**Tags:** webhooks, gform\_webhooks\_request\_data, admin-label\
**Created:** [March 10, 2022, 6:48pm UTC](https://community.gravityforms.com/t/webhook-send-admin-field-label-resolved/12148 "2022-03-10T18:48:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hodel](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/hodel/32/4162_2.png) [@hodel](https://community.gravityforms.com/u/hodel)\
**Post date:** [March 10, 2022, 6:48pm UTC](https://community.gravityforms.com/t/webhook-send-admin-field-label-resolved/12148/1 "2022-03-10T18:48:32Z")

</div>

Hi,

Is there a way to have a webhook send the Admin Field Label instead of the field ID by default? I have a form with over 30 fields and it would be nice if I didn’t have to map each one.

---

<div class="post-metadata">

**Author:** ![uamv](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/uamv/32/1412_2.png) [@uamv](https://community.gravityforms.com/u/uamv)\
**Post date:** [March 10, 2022, 9:46pm UTC](https://community.gravityforms.com/t/webhook-send-admin-field-label-resolved/12148/2 "2022-03-10T21:46:05Z")

</div>

This should swap the keys from field IDs to admin labels when performing a webhook request. You’ll want to update the check for `SpecificWebService` or replace with a check on your specific feed ID.

```auto
// Replace keys w/ admin labels when running webhook request
add_filter( 'gform_webhooks_request_data', function( $request_data, $feed, $entry, $form ) {

	if (
		rgars( $feed, 'meta/requestBodyType' ) === 'all_fields'
		&& strpos( rgars( $feed, 'meta/requestURL' ), 'SpecificWebService' ) !== false
		 ) {
             
		gf_webhooks()->log_debug( 'gform_webhooks_request_data: replacing keys with admin labels.' );

		foreach( $form['fields'] as $item ) {

			if ( $item->adminLabel != '' ) {

				if( isset( $item->inputs ) && is_array( $item->inputs ) ){
					foreach ( $item->inputs as $input ){
						$request_data[$item->adminLabel . '-' . $input['label'] ] = rgar( $entry, $input['id'] );
						unset( $request_data[$input['id'] ] );
					}
				} else {
					$request_data[$item->adminLabel] = rgar( $entry, $item->id );
					unset( $request_data[$item->id] );
				}

			} elseif ( $item->type == 'hidden' ) {

                $request_data[$item->label] = rgar( $entry, $item->id );
                unset( $request_data[$item->id] );

            }

		}

	}

	return $request_data;

}, 10, 4 );

```

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [March 10, 2022, 11:34pm UTC](https://community.gravityforms.com/t/webhook-send-admin-field-label-resolved/12148/3 "2022-03-10T23:34:11Z")

</div>

![this-up](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/3/35088b528a90cddf3d0a9f3d813c94e0ce2f4cb3.gif)

---

<div class="post-metadata">

**Author:** ![hodel](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/hodel/32/4162_2.png) [@hodel](https://community.gravityforms.com/u/hodel)\
**Post date:** [March 11, 2022, 12:18am UTC](https://community.gravityforms.com/t/webhook-send-admin-field-label-resolved/12148/4 "2022-03-11T00:18:45Z")

</div>

I was hoping I was missing a feature that let me toggle a setting, but since there doesn’t appear to be one, I appreciate the code to handle this.

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [March 11, 2022, 12:39am UTC](https://community.gravityforms.com/t/webhook-send-admin-field-label-resolved/12148/5 "2022-03-11T00:39:06Z")

</div>


