[Resolved] ProgressBar.value always returns 0?

Hello. I’ve used the Wix built-in “progressbars”…

In a Dataset, I’ve set up a current (500) and target value (1000), and connected the ProgressBar to my Dataset.

Unfortunately, even if my progress bar is shown as 50% on the webpage, this :

console.log($w("#progressBar1").value);
console.log($w("#progressBar1").targetValue);

Always return :

0
100

What should I do?
Is there any workaround that I could use to get my current value in my Database with the Wix API ?
Regards.

Did you remember to put this console.log inside dataset.onReady() like this?

$w.onReady(() => {
$w('#dataset1').onReady(() =>{
console.log($w('#progressBar1').value);
})
})

You are awesome, seriously!
It works, many thanks to you.

But I encounter a new issue. :frowning:
When I go to the “Preview”, it works fine… But when I go to the published website, I have “0” and “100” values printed in the console logs…
I’ve made another topic about this issue:

https://www.wix.com/corvid/forum/community-discussion/progress-bar-always-display-as-empty

Regards.

@jaimelesfritent2 You’re welcome :slight_smile: I posted an answer in the other thread.

hey guys !

ok, i’m trying to link my progressbar’s value to my dataset. I would like my progressbar to show the result of a for or against vote: the progression would show, in real time, the percentage of people voting “for” . could someone tell me how to correct this:

wixData.query( ‘sondage’ )
.contains( “reponse” , “pour” )
.contains ( “questions” , “referendum” )
.count()
.then((results) => {
$w( “#progressBar1” ).value = results.toString()

writing this code i knew it could be that simple… but i really don’t know what to do…

Thanks everyone !

lary

Anyone with an answer to this please?