Triggering a data grid from a survey response

Hi all,

I’m building an employee performance review form that includes a 1–5 rating scale using a survey component. I’d like to configure it so that when a manager selects a rating of 1 or 2, a data grid component is triggered to capture additional details or context.

Can anyone help with this?

Thanks 😃

Best reply by Erin Dwyer

Hi Linda,

You could conditionally hide/show your data-grid component based on the answer to the survey component. To do this you will need to use a JavaScript expression in the "advanced conditional" setting. Heres an example that has worked from me.

1. Set up your survey component. In this example i'm assuming you have set the values under the data tab to 1,2,3,4,5 as shown in the screen shot.

  1. Add the data-grid component to your form and navigate to the conditional tab.

  2. Open the "Advanced conditional" setting and insert the following JavaScript. Note you may need to modify the JavaScript for your specific form.

    show = Object.values(data.survey).some(value => Number(value) <= 2);

Here's what the outcome looked like in my example.

View original
2 replies