Send whatsapp message from odk-collect

Salutations.
I am working on a project with some farmers.
However, researchers want to be notified when a farmer enters data.
Farmers don’t use email on their smartphone, but whatsapp.
I could try with rest-service, but I would like the data to be sent by whatsapp to the researchers before the final entry, and therefore before the farmer finally uploads the data to the server.
So the best way is ex: com.whatsapp (extras)
I found this
ex:com.whatsapp(EXTRA_TEXT=’body’)
or
ex:com.whatsapp(android.intent.extra.TEXT=‘some text to send’)
in past posts
Whatsapp is opened, but nothing else happens.
Maybe you need to do ex: api.whatsapp.com?
You see I’m not a computer scientist, huh?
In fact, I’m a researcher in agriculture, I’m doing it for others!
Thank you in advance

Hi,

Try this:

numcel must include country code.

See documentation here: https://faq.whatsapp.com/general/chats/how-to-use-click-to-chat/

3 Likes

Thank you.
But if it is possible to use a link, it should also go with the webforms in Enketo ??? !!!
(I have to check if all farmers have an android device)
Instead it doesn't work for me, on the webform it gives me this:
" rel="noopener" target=" blank"
and if I click "page not found"

Unfortunately Enketo does not support dynamic URLs. Issue: https://github.com/enketo/enketo-transformer/issues/47

Try this for web:

Thank you.
It could be the solution!
I just have a problem now with apostrophes or comma.
I've tried many possible combinations, but none of them work for me:

concat('<a href=“https://wa.me/',${numero},'?text= ',${problemi},'“target=“_blank“<Invia WhatsApp</a>')
concat("<a href=“https://wa.me/",${numero},"?text= ",${problemi},"“target=“_blank“<Invia WhatsApp</a>")
*concat("<a href='https://wa.me/",${numero},"?text ",${problemi},"'target='_blank'<Invia WhatsApp</a>")
*concat('<a href="https://wa.me/',${numero},'?text= ',${problemi},'"target="_blank"<Invia WhatsApp</a>')
concat("<a href=″https://wa.me/",${numero},"?text= ",${problemi},"‶target=″_blank‶<Invia WhatsApp</a>")
concat("<a href=¨https://wa.me/",${numero},"?text= ",${problemi},"¨target=¨_blank¨<Invia WhatsApp</a>")
concat(“<a href='https://wa.me/”,${numero},”?text= “,${problemi},“'target='_blank'<Invia WhatsApp</a”)
concat(“<a href="https://wa.me/”,${numero},”?text= “,${problemi},“"target="_blank"<Invia WhatsApp</a”)

the result is sometimes an error, or this is it

I work with KoboToolbox (hopefully we can say here, right?), And my computer is a Linux Debian 11

Sorry, @LN is right. It does not work in Enketo.

1 Like

Hi @LN @Alexander_Torrado
A similar hiccup: COPY data to clipboard via intent

Appreciate your feedback.

It is unfortunately not possible to use dynamic URLs with Enketo. Here's the problem: https://github.com/enketo/enketo-transformer/issues/47

Correct, but do make sure you take a look at a possible alternative that I mentioned in that issue:

type name label appearance calculation
text url Click to send to whatsapp url concat('https://wa.me/', ${phone}, '?text=', 'Hi')

Hello,

Sending message to individual number is possible and works.
How can i share the message to the group.
I tries to used the group unique iD instead of mobile number.

Thank you in advance!

I think sending a message to a group might not be supported. It's possible to open such a group if you know its id but that's it.

1 Like