Manage Poll Options
Guide: Managing Poll Options with pollz-js SDK
Prerequisites
Before you proceed with managing poll options using the pollz-js SDK, ensure that you have already initialized the SDK and created a poll by following the relevant guides in the "Guides" section.
Manage Poll Options
You can add, delete, or rename poll options with ease using the pollz-js SDK.
Step 1: Import the SDK
In your Node.js application, ensure you have already imported the pollz-js SDK:
Step 2: Add a Poll Option
Use the addOption
method provided by the pollOptions
module of the SDK to add a new option to a specific poll. Provide the poll ID and the label for the new option.
Replace 'your-app-id' and 'your-app-secret' with the actual credentials obtained from the Pollz platform. Adjust the pollId
and the label for the new option according to your application's context.
Step 3: Delete a Poll Option
Use the deleteOption
method provided by the pollOptions
module of the SDK to delete a poll option. Provide the option ID as an argument.
Step 4: Rename a Poll Option
Use the renameOption
method provided by the pollOptions
module of the SDK to rename a poll option. Provide the option ID and the new name for the option.
Congratulations! You have successfully managed poll options by adding, deleting, and renaming them using the pollz-js SDK. Explore more SDK features and functionalities to customize your application's polling experience. Refer to the relevant guides for detailed instructions on other SDK capabilities.
Last updated