Skip Navigation

[Resuelto] Making a simple survey & need some help with creating a view to display results

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem: I would like to show a View of posts and calculate the total number of posts with each custom field value, like the results of a survey.

Solution: There's nothing built-in to Views that will calculate the total number of posts with a specific custom field value on-the-fly, so the display you described must be built out piece by piece using Views and Views shortcodes. You could use multiple filtered Views to achieve something similar. For example:
- View of submissions filtered by custom field "Question 1", answer "Yes"
- Use the wpv-found-count shortcode to output the number of submissions.

- View of submissions filtered by custom field "Question 1", answer "No"
- Use the wpv-found-count shortcode to output the number of submissions.

- View of submissions filtered by custom field "Question 1", answer "I don't know"
- Use the wpv-found-count shortcode to output the number of submissions.

- A second View of submissions filtered by custom field "Question 1", answer "No"
- In the loop output editor, display the "reason" free-response field

...and so on for each question.

Related documentation:
https://toolset.com/documentation/user-guides/views-shortcodes/#vf-155378

This support ticket is created hace 4 años, 10 meses. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Este tema contiene 3 respuestas, tiene 2 mensajes.

Última actualización por Jay hace 4 años, 10 meses.

Asistido por: Christian Cox.

Autor
Mensajes
#1285555

Jay

I am making a simple survey and need some help with creating a view to display results.

I have a CPT with some radio fields and a single line textbox that gets conditionally displayed when a specific option is selected for each set of fields.

For example, my form looks like this:

Question #1
-- Yes
-- No (triggers conditional text field for user to enter "Reason")
-- I don't know

Question #2
-- Yes
-- No (triggers conditional text field for user to enter "Reason")
-- I don't know

Question #3
-- Yes
-- No (triggers conditional text field for user to enter "Reason")
-- I don't know

No problems there. But I would like to create a view to display the results of the submissions that displays like this:

Question #1
Yes (12)
No (3)
I don't know (5)
Reason for voting 'No' entry 1
Reason for voting 'No' entry 2
Reason for voting 'No' entry 3

Question #2
Yes (13)
No (2)
I don't know (5)
Reason for voting 'No' entry 1
Reason for voting 'No' entry 2
Reason for voting 'No' entry 3

Question #3
Yes (11)
No (0)
I don't know (9)

Could anyone give me insight as to how to set up a view to display this?

#1285575

Jay

Sorry, made a mistake, on question #2 view results it should say:

Question #2
Yes (13)
No (2)
I don't know (5)
Reason for voting 'No' entry 1
Reason for voting 'No' entry 2

#1285701

Hi, there's nothing built-in to Views that will calculate the total number of posts with a specific custom field value on-the-fly, so the display you described must be built out piece by piece using Views and Views shortcodes. You could use multiple filtered Views to achieve something similar. For example:
- View of submissions filtered by custom field "Question 1", answer "Yes"
- Use the wpv-found-count shortcode to output the number of submissions: https://toolset.com/documentation/user-guides/views-shortcodes/#vf-155378

- View of submissions filtered by custom field "Question 1", answer "No"
- Use the wpv-found-count shortcode to output the number of submissions: https://toolset.com/documentation/user-guides/views-shortcodes/#vf-155378

- View of submissions filtered by custom field "Question 1", answer "I don't know"
- Use the wpv-found-count shortcode to output the number of submissions: https://toolset.com/documentation/user-guides/views-shortcodes/#vf-155378

- A second View of submissions filtered by custom field "Question 1", answer "No"
- In the loop output editor, display the "reason" free-response field

...and so on for each question.

#1286405

Jay

My issue is resolved now. Thank you!

Este ticket ya está cerrado. Si eres cliente de Toolset y necesitas ayuda relacionada, abre un nuevo ticket de soporte.