# Conditional Logic based on survey score

Hi, we are thinking about switching over to gravity forms. There is only one project where we are not sure if we can get it to work with your software. We have a customer that wants to use the “survey” functionality and based on the answers, to change up some pages.

Example Survey:

We are using 4 Rows with questions like:

1. Waiting Time
2. Treatmtent
3. After Effect
4. Recovery

For every Question we have 5 options to choose:
Very satisfied (5 points)
Satisfied (4 points)
Neutral (3 points)
Unsatisfied (2 points)
Very unsatisfied (1 point)

If we get a total of 4 points up to 16, we want to show a specific page. If we get a total f 17 to 20, we want to show a different page.

Basically we want to use conditional logic based on the answers (total score) of the likert survey element.

Can we achieve that build in and if not, can you provide some custom code in order to achieve that?

Bests Ronald

You will want to add additional confirmations to your form. These additional confirmations have support for conditional logic, where you can use the Survey Total score for your logic rules.

You can read more about conditional logic for confirmations here: Conditional Logic in Form Confirmations - Gravity Forms Documentation

Hi, thank you for your answer. The Problem is that this is after submitting the form. I need different fields in the process depenting on the score of the likert scale. bests, Ronald

Survey score is calculated after submission, therefore you can’t use it to display/hide other fields in your form.

You could just forget about Survey fields and use regular radio buttons with the “show values” enabled. This will allow you to put numeric values for each field choice, and use them for Number fields with calculation enabled: Using Calculations - Gravity Forms Documentation

These calculations are available to show/hide form fields.

1 Like

Hi Ronald,

With 2 steps in a workflow built with Gravity Flow you absolutely can do this with ease. I put together a quick walkthrough video showing how it combines the use of conditional logic on some html fields tied to the total score, our Form Connector extensions’ Update Fields step type to map the likert score into a number field, and having the forms’ confirmation redirect to an inbox (shortcode or block) that uses an approval step for the appropriate html fields get displayed.

I would expect you’d want to do some further customization around CSS/theme so that the result/landing page for the confirmation redirect looks less like the approval screen with how you describe your survey. But it could also be a stepping stone to engage the customer in other follow-up action. At the end of video I cover a few options like using the expiration setting to limit how long they could review their answers/result/etc.

Hope that helps.
Jamie

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.