Use this filter to dynamically change the name of your saved PDF file. This is useful if you cannot accomplish the filename you want using Gravity Forms merge tags alone, or if you need to conditionally change the filename based on a user’s response.

add_action( 'gfpdf_pdf_filename', function( $name, $form, $entry, $settings ) {
/* Only change the name of a specific PDF (we don't want all of them to use this new name ) */
if( '56c14c955d989' == $settings['id'] ) {
/* Pull the first 10 characters from the $entry['date_created'] string which contains the yyyy-mm-dd format we want */
$year_month_date = substr( $entry['date_created'], 0, 10 );
/**
* Do NOT include the .pdf extension
* Note: Mergetags will not be processed if included at this stage. Use the $entry array instead.
*/
return "Filename_{$entry[1]}_{$year_month_date}";
}
return $name;
}, 10, 4 );

You might also like to dynamically change the PDF name based on a response the user provided: