Hi, I have a database and I want to extract the email addresses using a filter and display them with each email address separated with a comma. How could I do this?
I can display the addresses with a repeater but they won’t have the comma between each name or be closer together. Thanks!
So do something like:
import wixData from 'wix-data';
$w.onReady(() => {
wixData.query("CollectionName")
.isNotEmpty("email")
//add here some fields you want to filter by, using .eq(), contains() etc..
.limit(1000)
.distinct("email")
.then(r => {
const emails = r.items;
$w("#text1").text = emails.join(",");
})
})
Thanks for replying. I just saw this. I’ll give it a try.thanks again
J.D. thank you so much for providing this code. Worked perfectly! I was even able to sort the addresses alphabetically
you’re welcome :