Hello guys, I’ll be brief on the question …
I have a database that has cell phone numbers and on one page I have a repeater and I need to insert a WhatsApp icon with the following link:
https://wa.me/( DATABASE PHONE )
I am not able to make this connection with the database and I got the correct link.
Hello,
I assume you store all the links in a database collection.
In this case, you will need to add the icon to a repeater, query your dataset and set the link to be the relevant item from a collection.
Your code should look something like this:
import wixData from 'wix-data';
$w.onReady(function () {
wixData.query("Links")
.find()
.then((results) => {
let item = results.items;
$w('#repeater1').data = item;
$w('#dataset1').onReady(() => {
$w("#repeater1").forEachItem(($item, itemData, index) => {
$item("#vectorImage1").link = itemData.newField;
})
})
})
})
Don’t forget to change the IDs 