Introduction
This component is developed as a SharePoint Framework web-part to create poll, capture response from the user’s and to display the results in a graphical view. This quick poll is very easy to maintain and quick to set up. The list ‘QuickPoll‘ which captures all the question and responses will be created automatically.
Features
- Easy to setup with most of the configurations are optional.
- Flexible to use without any critical configuration.
- More than one poll questions can be added.
- Schedule the poll questions in advance using the date parameters.
- Option to choose the poll that has to be visible to the end users.
- Poll response can be viewed via graphical representation as charts.
Properties
- Display poll based on date – This property will check for the ‘Start Date’ and ‘End Date’ on the poll questions to display the correct poll question to the end user. The ‘Start Date’ and ‘End Date’ on the poll question will be enabled only when this property is turned on.
- Poll Questions – Manage the collection of poll questions and choices.
- Question Title – Title of the question.
- Choices – Choices separated by comma.
- Multi Selection – Whether the users are allowed to choose one or multiple.
- Start Date – Date when the end user can start seeing the poll question.
- End Date – Last day of the poll question visible to the end user.
- Success Message – Message to be displayed to the user after successful submission. It is optional, if not provided the default message ‘Thank you for your submission‘ will be displayed.
- Response Message – Message to be displayed to the user with the user response, once the user has submitted. It is optional, if not provided the default message ‘You Voted For: User Response‘ will be displayed below the chart.
- Submit button text – Text to be displayed on the submit button. It is optional, if not provided the default text ‘Submit Vote‘ will be displayed.
- Preferred Chart Type – Chart type to display the overall response for the question.
Note:
- Poll questions with the same ‘Start Date’ and ‘End Date’ will follow the sort order to display the latest question to the end user.
- Once the user started to response to the poll, do not delete the question from the question collection. All the questions are mapped based on the ID auto generated. It cannot be recovered once deleted.
- Make sure the Multi Choice option is chosen wisely, do not change once the user started to response to the poll.
Preview

Source Code
The above web-part is shared with the community and is of free to use. Please click the below link to download the code and have fun.
https://github.com/pnp/sp-dev-fx-webparts/tree/master/samples/react-quick-poll
Happy Coding…
would this be compatible if deployed in SP2016?
LikeLike
Hi Denisse, the solution reference on the blog post points to the latest version which is only for SharePoint online (v1.11.0). But you can create a solution using 1.4.1 for SP 2016 and then you can replicate the code. It should work. Let me know if you encounter any issues.
LikeLike
Hi Sudharsan,
I have tried this webpart in classic page. It is not working. It is working in modern site page only. Could you please tell me how to integrate this in classic page.
Thanks
LikeLike
Hi, I haven’t tested in the classic page. Are you receiving any error? let me try it out and let u know.
LikeLike
Hi,
Getting Config Your Poll screen after configured the Poll.
Error in Console: PnPjs is running in ie11 compat mode. Not all features may work as expected.
I am using Chrome browser only. But it is showing PnPJs is running in ie11 compat mode.
LikeLike
Hi Naresh, can you try the recommendation from the link https://pnp.github.io/pnpjs/concepts/polyfill/. Meanwhile I will troubleshoot and let u know the outcome.
LikeLike
Ok. It will be more helpful if the poll is run on classic pages. Please check and let me know.
LikeLike
Sure. Give me some time, will update you once verified.
LikeLike
Hi Sudharsan, Thank you for this quick poll, it works great !! (Using in O365)
just an update/fix, I have to update below code in getAllUsersResponse Method.
From:
currentPollResponse: usersResponse[0].Response ? usersResponse[0].Response : usersResponse[0].MultiResponse.join(‘,’)
To:
currentPollResponse: filRes[0].Response ? filRes[0].Response : filRes[0].MultiResponse.join(‘,’)
Else, it gives always the first person response in “You voted for: ”
Once again thanks!
LikeLike
Hi Rishi, thanks for the info. I will update and commit the code to the repo asap. Let me know if you have any clarifications.
LikeLike
Hi I am trying to run the command npn-install but getting errors
LikeLike
Hi, you can send me the info to sudharsan_1985@live.in email address.
LikeLike