| CARVIEW |
Select Language
HTTP/2 301
date: Sun, 28 Dec 2025 21:29:55 GMT
content-type: text/html; charset=UTF-8
location: https://docs.gravityforms.com/gform_post_note_added/
server: cloudflare
strict-transport-security: max-age=604800
strict-transport-security: max-age=31536000; includeSubDomains
x-content-type-options: nosniff
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
x-frame-options: SAMEORIGIN
content-security-policy: frame-ancestors 'self';
referrer-policy: no-referrer
referrer-policy: strict-origin-when-cross-origin
x-redirect-by: WordPress
fastcgi-cache: EXPIRED
cf-cache-status: DYNAMIC
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=PWEHRk7%2BQKHJ%2FNRIC%2FCOpTdCmcjGvJw%2F5TCiUG7rJR0rtq2eX5efEuNeuaucu6EinfZG0%2FBgUAC3SVqJV4aNJ1LGokUbqjRuKfV6oL5ZpnB%2BPsfA"}]}
cf-ray: 9b5427e5a869b277-BLR
HTTP/2 200
date: Sun, 28 Dec 2025 21:29:56 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
vary: Accept-Encoding
strict-transport-security: max-age=604800
strict-transport-security: max-age=31536000; includeSubDomains
x-content-type-options: nosniff
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
x-frame-options: SAMEORIGIN
content-security-policy: frame-ancestors 'self';
referrer-policy: no-referrer
referrer-policy: strict-origin-when-cross-origin
link: ; rel="https://api.w.org/"
link: ; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
fastcgi-cache: EXPIRED
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=ybeD%2BjCkzD9DTh5Im9R3FxD5vQ0ukICst8HJS9kcyS38Edvijhk51U%2F23zMCVU7UllHdglYFYtfKjpXYLsDFLd8SAJvS%2FvrHQkRwpoLZ4UQzY651"}]}
cf-cache-status: DYNAMIC
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
content-encoding: gzip
cf-ray: 9b5427ebe9e2b277-BLR
gform_post_note_added - Gravity Forms Documentation
gform_post_note_added
Description
The “gform_post_note_added” action is triggered after a note is added to an entry in Gravity Forms, allowing further actions to be performed.
Usage
add_action( 'gform_post_note_added', 'your_function_name', 10, 7 );
Parameters
- $note_id integer
The ID assigned to the note by the database. - $entry_id integer
The ID of the entry the note was added to. - $user_id integer
Zero or the ID of the user who added the note. - $user_name string
The name of the plugin or the user_name of the user who added the note. - $note string
The note that was added. - $note_type string
The type of the note that was added. - $sub_type string
The subtype of the note that was added.
Examples
Log failed entry
Occasionally, a database error can occur when saving the field values for an entry. This code snippet can be used to create a draft entry from the submitted values and write it to the core log.
add_action( 'gform_post_note_added', function ( $note_id, $entry_id, $user_id, $user_name, $note, $note_type, $sub_type ) {
if ( $note_type !== 'save_entry' || $sub_type !== 'error' ) {
return;
}
$entry = GFFormsModel::get_current_lead();
$log_entry = json_encode( $entry, JSON_INVALID_UTF8_SUBSTITUTE );
if ( ! $log_entry ) {
$log_entry = $entry;
}
GFCommon::log_debug( "gform_post_note_added: Draft entry based on values for failed entry (#{$entry_id}) => " . print_r( $log_entry, true ) );
global $wpdb;
GFCommon::log_debug( 'gform_post_note_added: gf_entry_meta meta_value charset = ' . print_r( $wpdb->get_col_charset( GFFormsModel::get_entry_meta_table_name(), 'meta_value' ), true ) );
}, 10, 7 );
Send notifications configured for the custom event note_added
The following example assumes you have already added a custom notification event with the filter gform_notification_events defined as ‘note_added’. It will check if there’s any active notification configured for that event, and process them if any.
add_action( 'gform_post_note_added', 'send_note_added_notifications', 10, 2 );
function send_note_added_notifications( $insert_id, $entry_id ) {
GFCommon::log_debug( __METHOD__ . "(): Running for entry id {$entry_id}" );
$entry = GFAPI::get_entry( $entry_id );
$form_id = rgar( $entry, 'form_id' );
$form = GFAPI::get_form( $form_id );
// Replace note_added with the name you have used to define your event
$event = 'note_added';
$notifications_to_send = GFCommon::get_notifications_to_send( $event, $form, $entry );
$log_notification_event = empty( $notifications_to_send ) ? 'No notifications to process' : 'Processing notifications';
GFCommon::log_debug( "gform_post_note_added: {$log_notification_event} for {$event} event." );
if ( ! empty ( $notifications_to_send ) ) {
GFAPI::send_notifications( $form, $entry, $event );
}
}
Source Code
This action hook is located in forms_model.php.