Actions3
Overview
This node allows users to create and manage polls within Zalo group chats. It is particularly useful for gathering opinions, making decisions, or conducting surveys among members of a Zalo group. The node supports creating polls with multiple options, setting voting rules such as allowing multiple choices or anonymous voting, and configuring poll expiration and pinning behavior.
Practical examples include:
- Creating a poll in a team chat to decide on meeting times.
- Running anonymous surveys to collect honest feedback.
- Allowing participants to add new options dynamically during the poll.
Properties
| Name | Meaning |
|---|---|
| ID Nhóm (groupId) | The ID of the Zalo group where the poll will be created (only works with groups). |
| Chủ đề bình chọn (question) | The question or topic of the poll. |
| Kiểu nhập lựa chọn (optionInputType) | How poll options are entered: "Danh sách" (list) to input each option separately, or "Văn bản" (text) to input all options in one text field separated by commas. |
| Các lựa chọn (pollOptionsCollection) | When using list input type, a collection of individual poll options. Each option is a string describing a choice. |
| Các lựa chọn (optionsString) | When using text input type, a single string containing all options separated by commas. |
| Thời hạn bình chọn (expiredTime) | Optional expiration date/time for the poll. Leave empty if no expiration is desired. |
| Ghim lên đầu trò chuyện (pinAct) | Boolean to pin the poll message at the top of the chat. |
| Chọn nhiều phương án (allowMultiChoices) | Boolean indicating if participants can select multiple options when voting. |
| Có thể thêm phương án (allowAddNewOption) | Boolean indicating if participants can add new options to the poll. |
| Ẩn kết quả khi chưa bình chọn (hideVotePreview) | Boolean indicating if poll results should be hidden until the participant votes. |
| Ẩn người bình chọn (isAnonymous) | Boolean indicating if voters' identities should be hidden from other participants. |
Output
The node outputs JSON data containing the result of the poll creation operation. The output includes:
success: A boolean indicating whether the poll was successfully created.response: The raw response object returned from the Zalo API after creating the poll.groupId: The ID of the group where the poll was created.createPollData: An object summarizing the poll parameters used for creation, including question, options, expiration time, pin status, and voting rules.
If an error occurs, the output JSON contains an error field with the error message.
No binary data output is produced by this node.
Dependencies
- Requires an API key credential for authenticating with the Zalo platform.
- Uses the Zalo API client library internally to interact with Zalo services.
- Node configuration must include valid credentials with cookie, IMEI, and user agent information for authentication.
- Network access to Zalo's API endpoints is required.
Troubleshooting
Common issues:
- Missing or invalid group ID will cause poll creation to fail.
- Providing no poll options or empty options list will trigger an error.
- Invalid or expired API credentials will prevent successful API calls.
- Incorrect formatting of options when using text input type may lead to empty or malformed polls.
Error messages:
"Poll options cannot be empty": Ensure that at least two non-empty options are provided."Zalo API not initialized": Check that credentials are correctly configured and valid."Failed to create poll": Review the poll parameters and ensure the group ID is correct and accessible.
To resolve errors, verify all required inputs, confirm credentials, and check network connectivity.
Links and References
- Zalo Official API Documentation
- Zalo Poll Feature Overview (example link, replace with actual if available)