why the text still blank? help me fix this :-)

hi! hello i am new to wix and with programming and i am indonesian the language are soo much different :frowning: so i hope you guys can help me :slight_smile:


okay here i have a code

// For full API documentation, including code examples, visit Velo API Reference - Wix.com
import wixData from ‘wix-data’;

$w.onReady( function () {
//TODO: write your page related code here…
wixData.query(‘gameStore’)

    .eq('title', $w('#dropdown1').value) 

    .find() 

    .then(res => { 

let items = res.items[0];

let price = items.price;

        $w("#text15").text = price; 
    }) 

});

i just wanna show price field from the queried item, the code looks nice but i don’t know why it just leave a blank text.

i am trying to be nice, and sorry, please help.

Regards, Ukaz

You should have:

let item = res.items[0];
console.log(item);
let price = item.price;
$w("#text15").text = price;

As you can see in the above code, I added a console.log() statement so that you can inspect the contents of the item.

thanks for the reply yisrael… and sorry for my late reply

the first problem is

$w("#text15"#text15").text = price;

parsing error unexpected token '#
then i am trying to delete #text15" then another error happened

undefined at

console.log(item);

i don’t understand, the code looks nice and item already defined as res.items.

please help and thankyou

Thankyou again, Ukaz