WhatsApp for Communication

Kent_Wu
Participant II

Hi,
Try this when you want your client to use Whatsapp for the communications.

Objective: “Button” for WhatsApp in the contact table.

Behavior => Action ( Create a New Action)

See the picture attached.

Select the table with the telephone number (must include international code without the plus)

Do this => External:go to a website

Launch External => Select “ON”

WhatsApp resource: https://faq.whatsapp.com/general/chats/how-to-use-click-to-chat/

Happy Creating Apps,
Kent Wu

19 39 10.1K
39 REPLIES 39

Francios
Participant III

Thanks for the tip @Kent_Wu. Will definitively investigate.

Thank you @Kent_Wu.
Here are some additional information:

In my experience, using
CONCATENATE("whatsapp://send?phone=",[Phone Number])
is even better.

Because using https://wa.me/ will open an extra tab in the browser, checking if WhatsApp is installed (on Windows and some Android phones).
Using whatsapp:// will directly open WhatsApp.
As described in the above article.

Better:

CONCATENATE("whatsapp://send?phone=",ENCODEURL([Phone Number]))

See also:

Hi @Steve thank you for the hint with ENCODEURL([Phone Number]). But since the format has to be straight forward, ENCODEURL() is not necessary, it could even cause problems.

This is the format you have to use. Otherwise it will not work. The number has to be without any spaces, brackets, dashes, plus signs, and leading zeros.

https://wa.me/12345678910

EXTRACTNUMBERS() will not work when you have dashes in your phone number like 1234/5678910. Because in this case EXTRACTNUMERBS will divide 1234 with 5678910.
It will also not work with spaces, because it would extract more than one number.
Maybe a mix with SUBSTITUTE() and EXTRACTNUMBERS()

Like this?

Shame on me

how can i attach photo ?

Share on WhatsAppEMPLOYEE DETAILS ” &
"%0A%0AID NO:- " & ENCODEURL(SUBSTITUTE ([ID NO:], ‘+’, “” ))
"%0ANAME OF EMPLOYEE:- " & ENCODEURL(SUBSTITUTE ([NAME OF EMPLOYEE], ‘+’, “” ))
"%0APROFESSION:- " & ENCODEURL(SUBSTITUTE ([PROFESSION], ‘+’, “” ))

and i need to attach photos from app

It works like a champ! Thanks Steve!!!

This expression can be used to bring the Phone Number in the right format.
49 is the prefix here in Germany.

SUBSTITUTE("49"&
		NUMBER(
			SUBSTITUTE(
				SUBSTITUTE(
					SUBSTITUTE(
						SUBSTITUTE(
							SUBSTITUTE([Mobile],
							" ",""),
						"-",""),
					"/",""),
				"(",""),
			")","")
		),
"4949","49")

Maybe @Steve or @Aleksi have an easier way to do it

Maybe try EXTRACTNUMBERS()?

SUBSTITUTE(EXTRACTNUMBERS([Mobile]), " , ", "")

See also:

Without knowing details, it’s possible that the ExtractNumbers() won’t work if either the area code or phone number itself contains leading zero.

Thanks for this post.

What about if we want to add pre-filled text from our tables to the message?


Is this the only way?

Can we do that with this ?

SUBSTITUTE(EXTRACTNUMBERS([Mobile]), " , ", “”)

Hi @Nicolas_Feldman Yes that’s possible.
If you have a column with the Pre-Filled-Text, you can use this in your expression. Don’t forget to use ENCODEURL()

CONCATENATE(
  "whatsapp://send?phone=",
  SUBSTITUTE(EXTRACTNUMBERS([Mobile]), " , ", “”),
  "&text=",
  ENCODEURL([Pre-Filled-Text])
)

Hello everyone!

This link to WhatsApp is a really useful tool, even more with the pre-filled-text, I understand until know that sending messages to a specific phone number is possible(or at least letting it ready to just confirm sending it), but… What about doing the same but to pre-fill the message to be sent to a WhatsApp Group?

Looking trough it I found that WhatApps groups have kind of a UniqueID, I pressume that cause when you want to share a Link for somebody to join a group appears something like this:

https://chat.whatsapp.com/KbJfrbqnSZi2xzbXXXXXX

I presume the uniqueid or the group ID is the part after the .com/

I am planning to use this feature to send some info already loaded to the APP to a group of people in WhatsApp, the workaround for know would be to pre-fill the message with the trick you showed and sending it to a single person, then taking that message and send it to the group, but I ask in order to see if any of you know a better way to do the same (Open WhatsApp and Pre-Fill a message) but for it to be sent to a group.

I already try:

CONCATENATE(“whatsapp://send?phone=KbJfrbqnSZi2XXXXXXXXXX”,"&text=",ENCODEURL([VENTA ID]))

Being “KbJfrbqnSZi2XXXXXXXXXX” what I assume is the group ID placed where phone number should be, the action button opens WhatsApp, but shows an error message:

"Couldn’t look up phone number KbJfrbqnSZi2XXXXXXXXXX because it’s too short."

Thanks in advance for any help you may share!

Hi @JA003 that’s a good question. I did some testing, but it seems not to be possible.
The WhatsApp Business API once had this feature, but it was deprecated on July 2020, maybe for security reasons.

But there is a workaround:

CONCATENATE(
  "whatsapp://send?text=",
  ENCODEURL([Pre-Filled-Text])
)

This will open WhatsApp and you only have to choose the Group to send to.

Fabian!

Thanks a lot! That workaround worked just perfect for my use case!

Best regards.

Hi,

Fabian my friend, today suddenly the workaround stop working properly, when trying to open whatsapp from an action in AppSheet APP a message appears saying “Couldn’t open link” and whatsapp never opens.

I am using:
whatsapp://send?text=

Anybody else having troubles with this link? Is it possible that it was also deprecated by whatsapp?

Thanks in advance for any help you give.

Regards,

Hi @JA003 yes this also happens to me.
You can use

CONCATENATE(
  "https://wa.me/?text=",
  ENCODEURL([Pre-Filled-Text])
)

to get the same result: Open WhatsApp and choose the recipient.
But as I mentioned above, this …

This is the main reason I ended up using google chat groups, to auto send messages to groups via workflows. Also, no “press send” to was necessary

Could you please give more details ?

This is what I use today

There seem to be some methods to automatically send WhatsApp messages.
Maybe someone has the time or the knowledge to test it

Twilio
Remember: AppSheet already has a Twilio integration.


Zapier & Picky Assist


IFTTT & CallMeBot


Waboxapp & Wyzebulb


Waboxapp API
This could be used with an AppSheet Webhook.

Manage to do webhook to Twilio REST API to send whatsapp message from using twilio. refer to the guide here Guide: Twilio WhatsApp Message API WebHook with Appsheet Bot

If you use this code in the action (External:go to a website / Launch External ON):

CONCATENATE(
"https://api.whatsapp.com/send?phone=”,
“”,
“&text=”,
ENCODEURL(
CONCATENATE(
"Text Message : “,
[MESSAGE]
)
)
)

…it opens WHATSAPP and it asks to wich number (of your contacts) you want to send the message.
So if you have no need to use a (telephone) column of your app data!

Awesome @Giuseppe_Nugara thank you for sharing.
I tested. You don’t even need the phone part:

CONCATENATE(
  "https://api.whatsapp.com/send?text=",
  ENCODEURL([Pre-Filled-Text])
)

@Giuseppe_Nugara Have either of you used a workflow to send a message to WhatsApp. I want to send a link to a specific record to certain users. I have their WhatsApp # in my Users’ table.

Hi @Lucinda_Mason,

Did you manage to send WhatsApp messages using a workflow? I am trying to do the same but I don’t know how. I’d appreciate your help.

I didn’t pursue it any further. I’ve had other priorities so just let this wait. I’m hoping that AppSheet will add it in a direct way.

Top !!! Thanks a lot @Fabian !!

HI ! @Lucinda_Mason
I never tested it, but I think it’s possible only with an external service like Twilio and sure you can do that only with a deployed app.

Can Appsheet prepare for sending messages for whatsapp with images too ?

Thank you @Fabian for sharing this. I love it!
I was looking for an easy way to send WhatsApp Messages since long time

Thank you Fabian! It is very easy to send whatsapp messages with this API. I noticed that there are specific instructions to setup whatsapp with AppSheet in this link: Whatsapp Messages from AppSheet - CallMeBot API

Hey guys,

How do i break line on the text message?

For Exemple:

YOUR ORDER SUMMARY

DATE: [ORDER DATE]
LOCATION: [LOCATION]
PRODUCT: [PRODUCTS]
COLLABORATOR: [attendant]
PRICE:[TOTAL]
STATUS:[STATUS]

Type
"Your text{Carr Ret}
"

Top Labels in this Space