Combine 2 Query String Parameters to Populate One Field [RESOLVED]

I have to parameters that are being passed in a URL: invitee_first_name and invitee_last_name

I would like to dynamically populate a field with the values of both of these parameters separated by a space. I know how to pass one of the parameters into a field using the Advanced tab, but not two. Is it possible to combine them?

invitee_first_name invitee_last_name
invitee_first_name&invitee_last_name
invitee_first_name invitee_last_name
invitee_first_name%20invitee_last_name

You can use the hook method for dynamic population. So, setting invitee_full_name in your Advanced tab Parameter Name and hooking to gform_field_value_$parameter_name with this code should get you there…

add_filter( 'gform_field_value_invitee_full_name', function ( $value, $field, $name ) {
 
  $value = rgget( 'invitee_first_name' ) . ' ' . rgget( 'invitee_last_name' );

  return $value;
 
}, 10, 3 );

That worked, thank you.

2 Likes
© 2008 - 2021. Gravity Forms is a project by Rocketgenius Inc.