Disclaimer I am not a PHP expert and this is typically outside of the questions I answer but I know the community is kind of offline on weekends. I put together something for you below. If none of this works you can always look into Gravity Forms Populate Anything or also the URL params plugin
My solution (untested)
I’m assuming your first form is the one that gets the user’s name?
What you should do is set up a redirect confirmation on form1 to redirect to form2 and then in the ‘Pass Field Data via Query String’ field on form 1 enter name=and then select the merge tag from the merge tag dropdown which populates the name field.
Add this shortcode to your functions.php file.
add_shortcode('whatsapp_link', 'whatsapp_url_function');
function whatsapp_url_function( $atts ) {
extract( shortcode_atts( array(
'whatsappurl' => '',
), $atts ) );
// Get var from parameter in Gravity Forms confirmation page url
$whatsapp_link_url = $_GET[$whatsappurl]; // this $whatsappurl word has to be the same as the word in the extract above (but without the $)
// you can test with: return $_GET[$whatsappurl];
// Change the first part of the url to the whatsapp URL but leave the /$whatsapp_link_url variable
if( $whatsapp_link_url != '' ) {
return 'https://whatsappurl.com/$whatsapp_link_url';
}
}
Lastly, on form 2 in the HTML field add the shortcode [whatsapp_link whatsappurl=‘name’]
Right I drilled down through Sarahs post. The solution was in a post on stack exchange. Now when I use the shortcode below it ouputs the first name in html field. Quite a game changer for me really as ads some great flexibility for personalisation of the form.
[URLParam param='NameFirst']
Per the OP’s answer within their question:
With your help and some Googling, I put together a shortcode that returns the value of any url parameter. Here it is:
//THIS IS A CUSTOM SHORTCODE TO DISPLAY A PARAMETER FROM THE URL
function URLParam( $atts ) {
extract( shortcode_atts( array(
'param' => 'param',
), $atts ) );
return $_GET[$param];
}
add_shortcode('URLParam', 'URLParam');
I use the shortcode like this to get the trip_type from my URL: