Button for make a telephone call in mobile version taking the number from data base

Good day, I thank you in advance for the support that you have given to development from WIX, I have learned many things without being a programmer, today I wanted to ask for help.

I have a WIX project and I needed to make a button take a number from the database phone and make the call on a dynamic page of items, this means that every time you enter a different dynamic page, the button loads that diferent phone number depending on the entry for that item and when clicking open on the phone the Call application.

Again I appreciate all the support as I said I am not a programmer so if possible could you share the code to adapt it to the page?


If you want to look at making phone calls, then look at using the Wix Location API and the to function.

Make a phone call

import wixLocation from 'wix-location';

// rest of code... //

1 Like

Or just do it through the Wix Editor itself.

Or third party app.

As for dynamic calls, see this previous forum post for more info.

1 Like

Thank you very much I was able to achieve it, I thought about sharing a post with my solution but apparently it is not allowed to publish in the forum to anyone.

1 Like

Dynamic button for phone calls and whats app on item dynamic page (dinamic number from database)

My solution: On the dynamic page of item we create a text field to which we are going to name “phoneButton” and connect it to the database to the “telephone” field.

Then we create the button that sends the call and name it “phoneButton” which we will activate in properties on click and name the event as “phoneButton_click”

Then write the following code.

import wixLocation from 'wix-location';
export function phoneButton_click (event) {
wixLocation.to("tel:" + $w ("#telephone").value);

If you want the button to open whats app and also have a personalized message you must use this code and replace what you need rename the button "whatsButton and replace de **** for country code.

export function whatsButton_click (event) {
wixLocation.to("https://wa.me/****" + $w ("#telephone").value + "?text=hi,%20this%20is%20an%20example");

I clarify that I am not a programmer nor do I speak English, I have learned a lot in this space and I hope to contribute as a way to thank.

1 Like

Thanks for posting your working code, it will help others if they use the search function within the forum to look for similar issues.


What you have done below is fine as you keep it all together :+1:

@givemeawhisky this code is not working

I have a same situation i want to add onclick button call at dynamic page which will be profile for different users . In which users will share there information phone numbers as well to other who want it so they just have to tap on button and it will take it to directly on call . Could you please help me out with this .#gos