Sending Polls To WhatsApp Groups
Sending Polls to WhatsApp Group Collections.
| 5 minutes read | Level: Beginner | Last Updated: December 2025 |
Glific platform can be used to create polls. Send or scheudule the polls in advance to multiple groups.
Pre-requisites
- WhatsApp Groups Integration should be enabled. Read here
Create the poll in Glific platform
-
Go to the
WhatsApp Pollsunder theWhatsApp Groupssection -
Click on
Createand provide the title, the question of the poll in content and the options. Ensure you make the right choice for allowing multiple responses. -
Poll questions are limited to 255 characters.
-
Under Options enter up to 12 poll options.
-
Poll options are limited to 100 characters.
-
To allow users voting for more than one option, turn on
Allow multiple answers
- Click on
Save. This creates the poll. - Copy the UUID
Create a flow to send the poll
- Create a new flow
- Add a
call a webhooknode.
- By default,
FUNCTIONwould be selected. Leave this as it is.
- In the
FUNCTIONfield, select the pre-defined functionsend_wa_group_pollfrom the dropdown and give the result name.
- Add the parameters in the FUNCTION Body.
- Go to
FUNCTION Bodyon top right corner. You would see the following.
- Pass the following parameters.
{ "wa_group": "@wa_group", "poll_uuid": "" }
“poll_uuid”: ""from the polls list paging by selecting onCopy UUID.“wa_group”: “@wa_group”will remain as is.
- This completes the flow
5. Please note: No further send message node is needed to send the poll to WhatsApp group. The webhook success response sends the poll with the given poll uuid to the groups.
Here is a SAMPLE FLOW. To use this flow, go to the link, download the csv, and upload this flow using import a flow in your Glific instance. Change the poll_uuid in the webhook function body to match the poll_uuid of the poll you have created in your Glific instace.
Sending the poll to required WhatsApp Group or Collection.
- This can be done by setting a trigger to a WhatsApp Group Collection
- Or the particular flow can be started for the WhatsApp Group by starting a flow for the group like shown below.
Polls can also be used from Google sheet, to send different polls based on the date or any other incremental counter logic.
- Link a readable Google Sheet in the Glific, which has the Key and poll uuids
- Use Link a google sheet node to read the poll uuid from the sheet based on your choice of variables (could be date wise etc). Please note that above is just one example of how it can be used.
- Call the webhook function
send_wa_group_polland use the sheet result to populate thepoll_uuidin the function body of the webhook call.
- This flow picture is only to illustrate how google sheet can be used to send polls.
Getting the data of responses
- Responses to the polls are stored in the
wa_messagestables - The
typefield stores the type of message being sent or received. Filtering forpollunder this field gives all the poll type text messages sent from the number to the groups poll_contentfield contains the json structure for the poll. This contains the entire poll body, options and the vote count.- At present it is possible to get only the no of responses to a particular option, and not which phone number has responded what.
- Following query creates a view to get the aggregated output of all the polls and its responses. This can be further manipulated to get the responses for a particular poll across the various groups or drill down to responses from a particular group. (replace the xxxxxxxxxx with the table dataset from your chatbot. It is usually the phone number of your chatbot)
WITH distinct_data AS (
SELECT
id,
wa_group_id,
wa_group_name,
MAX(body) AS body,
MAX(poll_content) AS poll_content,
MAX(inserted_at) as inserted_at
FROM
`tides-saas-309509.917834811114.wa_messages`
GROUP BY id, wa_group_id, wa_group_name
),
parsed_data AS (
SELECT
id,
body,
wa_group_id,
wa_group_name,
JSON_EXTRACT_ARRAY(poll_content, '$.options') AS options,
inserted_at
FROM
distinct_data
)
SELECT
wa_group_id,
wa_group_name,
body,
JSON_EXTRACT_SCALAR(option, '$.name') AS option_name,
SUM(CAST(JSON_EXTRACT_SCALAR(option, '$.votes') AS INT64)) AS votes,
MAX(inserted_at) as inserted_at
FROM
parsed_data,
UNNEST(options) AS option
GROUP BY body, option_name, wa_group_id, wa_group_name
**Points to note: **
- While creating the poll, please populate the options you want to them to appear in when being read on WhatsApp
- Poll once created cannot be edited, please review and test thoroughly before using it in actual groups.