Connecting a Dataset URL to an Iframe Embed Element

Hi. My collection’s name is “urls”

wixData.query('spektrixUrl') // wrong collection name

in this query() you should point the collection name as an argument. I guess your collection’s name is ‘Tickets’ ?
So the code should be

$w.onReady(function () {
    wixData.query('Tickets') // collection name
    .eq('title', 'The Nutcracker – Dec 4')
    .find()
    .then(res => {
        $w('#spektrix').src = res.items[0].spektrixUrl;
    })
});

What is #ticketData ? Is it a dataset id?
You don’t need the dataset when working with velo code.

By the way, this code is really custom. I mean that you point the item name (‘The Nutcracker – Dec 4’) manually

 .eq('title', 'The Nutcracker – Dec 4')

But you can expand the functionality with velo and dynamically define the right name to retrieve.
Stuff like this

let ticket;
if (// some condition) ticket = 'The Nutcracker – Dec 4';
if (// some condition) ticket = 'The Nutcracker – Dec 20';

wixData.query('Tickets')
.eq('title', ticket)
.find()
.then(res => {
    $w('#spektrix').src = res.items[0].spektrixUrl;
})

You can create a variable that under some conditions (you choose what conditions) can be one or another value. And this value should be equal to your title name.

Or another way
You can once retrieve ALL the items from the collection and change the array item under some conditions.

wixData.query('Tickets')
    .find()
    .then(res => {
        console.log(res.items) // array of results. Every array item is a collection item
        if (// some condition) $w('#spektrix').src = res.items[0].spektrixUrl
        if (// some condition) $w('#spektrix').src = res.items[1].spektrixUrl
        if (// some condition) $w('#spektrix').src = res.items[10].spektrixUrl
    })
});

In this case you should check and know the order of items.

Or create your own way to define the correct name of a title in order to retrieve the url related to this title. You should know code to do that.
Hope that I’ve helped you :grin: