save rating to database

So I'm building a store in appian and i want the user to be able to rate a product and I want it saved so then ofter i can show an average rating of the product, what should I do in order to save the rating of the user in the database after i click the star icon or after i click a button to save the rating? i already have a database set up. Or if thats not possible is there any other way to do it?

  Discussion posts and replies are publicly visible