Indisponibilidade parcialshare-external
How to give Prefilled Options in Meta Whatsapp API
1

I want to know how can we send some prefilled options in our Meta Whatsapp Template?

This is my template which contains of 1 RadioButtons and 2 Checkboxes, I made this using "flow" (survey_feedback_form) category on Meta Developers site. This takes User choices , now when user wants to update the choice, rather than sending a new list, I want to send a list with all of the choices prefilled in this template.

Any ideas how can we achieve this ?

{ "messaging_product": "whatsapp", "to": number, "type": "template", "template": { "name": "user_assistance_messages", "language": { "code": "en_US" } }
}

Awanish
Enviada há cerca de 4 meses
Resposta selecionada
1

You will need to do two things:

1) Make sure your Flow JSON is configured correctly with init-values (reference: https://developers.facebook.com/docs/whatsapp/flows/reference/flowjson#form-configuration)

2) When you send the template message, you can use the flow_action_data property in the message payload to set the init-values in your Flow JSON (reference: https://developers.facebook.com/docs/whatsapp/flows/gettingstarted/sendingaflow#templatemessages)

Hope this helps - if this is not 100% clear, please share your Flow JSON and I'll try to provide more specific guidance.

17 de julho às 03:14
Bar
Awanish

Hi, I'm sending a custom flow which have multiple Radio buttons and few checkboxes, all in different section. I want to send those with prefilled data

22 de julho às 13:54
Awanish

I tried sending this payload, but it didn't work

{ "messaging_product": "whatsapp", "recipient_type": "individual", "to": number, "type": "template", "template": { "name": "template_name", "language": { "code": "en_US" }, "components": [ { "type": "button", "sub_type": "flow", "index": "0", "parameters": [ { "type": "action", "action": { "flow_token": "unused", // optional "flow_action_data": { "screen_0_RadioButtonsGroup_0": "2_Top_50_IT_Service_Providers", "screen_0_CheckboxGroup_1": [ "4_Retail", "1_Healthcare_Payors" ] } } } ] } ] } }

22 de julho às 14:01
Bar

When you say "it didn't work" what exactly happens?

Can you please send your Flow JSON as well so I can help debug?

22 de julho às 14:41
Awanish

How Can i send my flow JSON? I made it using Meta Templates, under "Blank" template section. Can we connect on some other medium? Maybe you can guide me better there.

What I'm trying to send from Postman is mentioned above

And this is response I receive from form, maybe this is what you're calling as flow JSON

{ "object": "whatsapp_business_account", "entry": [{ "id": "id", "changes": [{ "value": { "messaging_product": "whatsapp", "metadata": { "display_phone_number": "id", "phone_number_id": "id" }, "contacts": [{ "profile": {"name": "Awanish Mishra"}, "wa_id": "" }], "messages": [{ "context": { "from": "id", "id": "wamid.id==" }, "from": "", "id": "wamid.id", "timestamp": "1721116855", "type": "interactive", "interactive": { "type": "nfm_reply", "nfm_reply": { "response_json": "{\"screen_0_RadioButtonsGroup_0\":\"2_Top_50_IT_Service_Providers\",\"screen_0_CheckboxGroup_1\":[\"4_Retail\",\"1_Healthcare_Payors\"],\"flow_token\":\"unused\"}", "body": "Sent", "name": "flow" } } }] }, "field": "messages" }] }] }

22 de julho às 22:34