# Need help on Capturing rating

**URL:** <https://forum.wixstudio.com/t/need-help-on-capturing-rating/38341>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [July 6, 2021, 3:00am UTC](https://forum.wixstudio.com/t/need-help-on-capturing-rating/38341 "2021-07-06T03:00:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![djfs83](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/djfs83/32/29104_2.png) [@djfs83](https://forum.wixstudio.com/u/djfs83)\
**Post date:** [July 6, 2021, 3:00am UTC](https://forum.wixstudio.com/t/need-help-on-capturing-rating/38341/1 "2021-07-06T03:00:32Z")

</div>

Wish to collect rating from customers but the value does not update in the dataset, check several times the field name is correct, type also correct, never code before, I copy the code from

[https://support.wix.com/en/article/velo-tutorial-capturing-and-displaying-ratings](https://support.wix.com/en/article/velo-tutorial-capturing-and-displaying-ratings)

can anyone help me out here? any other why to do this?

export function ratingsInput1\_change ( event ) {  
// This function was added from the Properties & Events panel. To learn more, visit [About the Properties & Events Panel](http://wix.to/UcBnC-4)  
// Add your code for this event here:  
$w ( “#dataset1” ). onReady (() =\> {  
// get the current item from the dataset  
const currentItem = $w ( “#dataset1” ). getCurrentItem ();

// get the current average rating, number of ratings, and  
//total ratings for the current dataset item  
const average = currentItem . avg ;  
const count = currentItem . numRatings ;  
const total = currentItem . totalRatings ;

// get the new rating from the ratings input  
const newRating = $w ( ‘#ratingsInput1’ ). value ;

// calculate the new average rating based on the current  
//average and count  
const newAverageLong = ( total + newRating ) / ( count + 1 );  
// Round the average rating to 1 decimal point  
const newAverageShort = Number . parseFloat ( newAverageLong ). toFixed ( 1 );

// set the dataset fields to the new average, total  
// ratings, and number of ratings  
$w ( ‘#dataset1’ ). setFieldValues ({  
‘avg’ : newAverageShort ,  
‘totalRatings’ : total + newRating ,  
‘numRatings’ : ( count + 1 )  
});

// save the dataset fields to the collection  
$w ( ‘#dataset1’ ). save ()  
. catch (( err ) =\> {  
console . log ( ‘could not save new rating’ );  
});  
});

Thanks

---

<div class="post-metadata">

**Author:** ![yisrael-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yisrael-wix/32/1107_2.png) [@yisrael-wix](https://forum.wixstudio.com/u/yisrael-wix)\
**Post date:** [July 12, 2021, 7:42am UTC](https://forum.wixstudio.com/t/need-help-on-capturing-rating/38341/2 "2021-07-12T07:42:28Z")

</div>

The [Ratings by User example](https://www.grampsworkbench.com/Examples/Ratings-by-User) might be useful for your purposes.

---

<div class="post-metadata">

**Author:** ![wegotgreatdeals](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/wegotgreatdeals/32/30330_2.png) [@wegotgreatdeals](https://forum.wixstudio.com/u/wegotgreatdeals)\
**Post date:** [November 15, 2021, 8:59pm UTC](https://forum.wixstudio.com/t/need-help-on-capturing-rating/38341/3 "2021-11-15T20:59:55Z")

</div>

How exactly is this example supposed to help us? There seems to be a lot of us with this same issue and you keep offering up the same example sites. How do we fix the code? How do we make the code work for us? We don’t know how to code, and although we are following the Velo tutorial, its still not working. Have you all thought of doing a video tutorial instead of a vague article? Its going on over a month at the time that I write this that I have been dealing with this issue and Wix/Velo has been NO HELP.

---

<div class="post-metadata">

**Author:** ![yisrael-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yisrael-wix/32/1107_2.png) [@yisrael-wix](https://forum.wixstudio.com/u/yisrael-wix)\
**Post date:** [November 16, 2021, 5:18am UTC](https://forum.wixstudio.com/t/need-help-on-capturing-rating/38341/4 "2021-11-16T05:18:38Z")

</div>

@wegotgreatdeals Wix provides many resources to help users learn how to get the most out of Velo. We encourage users to take advantage of these resources which include video tutorials, full app examples (which can be loaded into the user’s editor), API documentation, and a wealth of articles describing a wide range of topics - from beginner to advanced.

To learn about programming with Velo, read the following articles that will help you start working with Velo:

- [About Velo by Wix](https://support.wix.com/en/article/about-corvid-by-wix) - what Velo is and what features it has.

- [Getting Started with Velo by Wix](https://support.wix.com/en/article/getting-started-with-corvid-by-wix) - step-by-step tutorial on how to start using Velo.

- [Onboarding to Velo by Wix](https://support.wix.com/en/article/onboarding-to-corvid-by-wix) - introduction to Velo with short tutorials.

For those users who need coding assistance, it is possible to find expert developers on the [Wix Marketplace](https://www.wix.com/marketplace/dynamic-brief?entry=general_corvid_Menu&serviceType=1&innerType=1&origin=velo_forum_networking) an online marketplace with top Velo web developers from around the world.

---

<div class="post-metadata">

**Author:** ![kricke73](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/kricke73/32/31574_2.png) [@kricke73](https://forum.wixstudio.com/u/kricke73)\
**Post date:** [February 10, 2022, 7:12am UTC](https://forum.wixstudio.com/t/need-help-on-capturing-rating/38341/5 "2022-02-10T07:12:23Z")

</div>

@wegotgreatdeals Hi Wegot! I have the same problem as you had (or still have) and also think that an easy video tutorial “for dummies” is a must because this is really not easy. In my case the ratings doubles or triples up for each click on stars and nothing have worked to get rid of that dilemma. Did you finally get a working code or are you still struggling with it?

---

<div class="post-metadata">

**Author:** ![yisrael-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yisrael-wix/32/1107_2.png) [@yisrael-wix](https://forum.wixstudio.com/u/yisrael-wix)\
**Post date:** [February 10, 2022, 7:38am UTC](https://forum.wixstudio.com/t/need-help-on-capturing-rating/38341/6 "2022-02-10T07:38:12Z")

</div>

@kricke73 No video tutorial is required as all that’s needed is to use the [Ratings by User example](https://www.grampsworkbench.com/Examples/Ratings-by-User) which shows precisely what’s needed. I’ve looked at your code and you have numerous errors which I have already pointed out and are still not corrected.

As you state, “this is really not easy”. In order to achieve your goal you will need to spend time learning how to program Velo. Copy and paste is not enough. One needs to understand what is being copied and why.

Use the learning resources that I posted previously and learn how to develop with Velo. Load the [Ratings by User example](https://www.grampsworkbench.com/Examples/Ratings-by-User) into the Editor, play with it, learn, and then adapt it to your own use. If you need assistance, you can hire an expert from the [Wix Marketplace](https://www.wix.com/marketplace/dynamic-brief?entry=general_corvid_Menu&serviceType=1&innerType=1&origin=velo_forum_networking) who can help you out.
