I’m working on a Form Submission where I want to retrieve phone numbers from users, but I want to store additional data on that submission. For example, I want to pair the phone number with a link, like so: [link]/[phone number]. This would be helpful to integrate a ‘Contact via Whatsapp’ where the link would look something like: https://wa.me/[phone number]. This would be stored in the CMS collection and then I can use this link as a Call to Action that would redirect them to start a WhatsApp conversation.
Here is my public share link: LINK
(how to access public share link)
Hey Andres, everything your describing sounds very simple and straightfoward. It’s not clear where you’re running into issues or what you’ve tried?
You’ll also want to share a readonly link to your project so we can see the part you’re having problems with.
One other thing I’m not clear on in your description- is why would you want the user to call themselves? If you are wanting them to be able to connect to you, you’d want your phone number in that link. Also, you’d probably want to create that link in your user interface and not in the CMS, though both are valid options.
Hello and thanks for your reply!
Here’s a bit more context:
As realtors sign up to our site, they will input their individual phone numbers, which will be stored in a collection item, under a ‘Realtors/Users’ collection. They will be given permission to publish their listings, which will be stored under a new collection that stores all listings.
In a nutshell, there will be an ‘All Listings’ page where potential buyers will be able to scout different properties from different realtors. In this case, I’m creating a CMS Card Item that contains the info of the property, and I want to include a WhatsApp button so that they buyer can click on it and automatically contact the realtor to which the property pertains to. For this, I’m thinking the easiest solution will be to add a custom HTML above the WhatsApp button that essentially uses the https://wa.me/ link but adds the phone number from the realtor from the collection, which would look something like this: https://wa.me/(phone number from collection).
FYI, I’m currently building this in Webflow, so there’s nothing I can share. Here is a link of a platform that does exactly that:
Each property in this link is from a different realtor, and if I click on different WhatsApp links, they all will contact different realtors, so that is exactly what I’m trying to accomplish here.
@andresesquivel, you can a read-only link to your project. Have a look at the link below.
@andresesquivel, you will be able to achieve this with the following:
<a href="https://wa.me/Agent - Phone">
Note: You will have to change the phone number in your CMS collection into the international format for this to work.
@choreus I tried the code and it won’t work. Does this only work for a Button or how can I make it work on a link block?
@andresesquivel, generally, you can make it work anywhere.
On which page have you tried to implement the code? I will have a look at it inside Webflow.
@choreus On the properties page. Designing on mobile now just for reference.
@andresesquivel, I have created a project showing you how to set it up. This is the read-only link.
Create an example button, give it a class and style it. Then create an embed, add the class and incorporate the necessary code.
Let me know if you can follow my setup.
Also, I’d advise you to always start designing at the base breakpoint, which is Desktop.
@choreus I see that you have built a button using an HTML embedd. Is there a way to just apply the link to an actual button by placing the HTML on top? I’m not a developer, so I wouldn’t know how to style the button if it’s custom HTML.
@andresesquivel, you can use the first element for styling purposes. You do this inside the Style panel, as you would with any other element.
The HTML embed only needs the
href="" for this to work.
Does that make sense?
Edit: Select the first button and change the color, background-color and/or font-size. You will see, that the embed button will change as well.
It does, but I can’t get it to work
Yep that’s perfect, and the easiest route.
In your collection you can either store the full WA link in a URL field, e.g.
Which will allow you to just bind it to any link or button.
Or you can store just the number itself ( no punctuation or spaces )
and then construct your link in an HTML Embed.
I’ve placed an HTML embed on top of my link block, with the following code (see attached)
It still won’t work.
What do you mean by “it won’t work?” What happens?
What I can see in your screenshot looks right.
I have no idea which page of your site you’re doing this on, so I can’t check for you. But the most likely issue is that the resulting number is malformed or missing digits.
If you can’t figure it out, tell us which page you’re actually implementing this on, and share the published page link as well so we can see what you’re generating.
@memetican, here’s the read-only link and the page in question. I have asked this earlier.
Edit: I guess this is the published page link.
Ideally, when I click the button, it should redirect me to open a WhatsApp chat, the same thing as if you were to click this link right now: Share on WhatsApp. However, when I click the Whatsapp button it does nothing.
Perfect, I was digging through the messages and couldn’t identify the right links. Thanks Julian.