The challenge for this week is to have an individual webpage for each result zone (bad, good, perfect) so in total 3 web pages which each one will be shown based on the conditional logic of the result segment.

So far I have the number field with the summed amount of values which is categorized as Poor, Good and Perfect. The notification and the content for each zone is different. This is why I am building 3 individual pages within WordPress.

Note that these pages should not be listed if someone searches on the website. Please refer to this blog if you want to read more about excluding the specific page from the search results page in WordPress.

The concept

Thinking about the solution will lead to somehow send that specific field to the website and find a way to use that number. Passing field data from Gravity forms is possible through Query Strings.

Confirmation type: Page.

Page: choose the proper confirmation page based on the logic (I needed to have a page with the results score less than 25. This is why I have named and built a page with the proper name.

Pass Field Data via Query String: I need to pass the first name field and the resultaat field which is the sum of values. The correct way is resultaat={Resultaat:43}&Name={Naam (First):44.3}

Conditional Logic: I want this page to be shown if the score is less than 25 which means the resultaat>0 & the resultaat <25. Then save confirmation.

So for now I have managed to pass specific fields using Query string. The URL structure will be changed to  Website-URL/resultaat-0-25/?resultaat= &Name=  #gf_52

If I fill the form and the result will be between [0-25], for example 5 and the first name is Milad, the URL will look like Website-URL/resultaat-0-25/?resultaat=5&Name=Milad#gf_52

Use the query string on WordPress page

In order to use the field data that has been passed using Query string in the page, The custom shortcode should be added to the theme’s functions.php

//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 resultaat value from my URL: Jouw resultaat is : [URLParam param=’resultaat’]

On top of that I use the short code below to get the name value from my URL: Beste [URLParam param=’Name’].