Interactive Rating Control in PowerApps

Introduction

One of the most popular elements on social media platforms and for any user-interactive necessity is rating. As I was creating the ratings, I came to understand that accurate rating captures a great deal of validation.

Scenario

In accordance with the requirements, we will add a rating control and adjust the display mode and default property.

Objective

The goal of this criteria is quite strict because numerous scenarios depend on the concept's grade. In notions like idea ratings or article ratings, it is helpful. We will develop a SharePoint list according to the specifications in order to calculate and project.

Step 1. The list structure would look like below.

A list structure might be created based on our requirements. I've made three distinct lists for this sample, and the data is displayed along with the list structure.

Article list structure

List structure

Article list content

List content

PostViewsOnArticle list structure

Post Views

Content

The third list will save data from power apps and the list structure looks like below.

 Save data

Step 2. Design screen and form.

The snapshot below displays every article that has been submitted. By selecting an item, we can check its details as well as the number of views it has received. I've taken control of the gallery so that it displays all items.

Design screen

Below is the display form which shows the variable View value. Variable View value shows gallery-selected item details.

View value

I'd like to display every possible viewpoint that individuals may have below. After viewing the details, we can click on each perspective to view it in more depth and score it. Once more, we will take advantage of Gallery control to display every view.

As you can see, I removed the title from the box label and added a button so that I could display the title as text while keeping it clickable.

Button

On selecting a button it should go to View description so the code looks like below.

 View description

Step 3. Save Logged in User in a Global variable.

We store user log-in information in a global variable to enhance efficiency. If not, User(). Email could be utilized directly whenever it was needed.

Global variable

Step 4. Add Rating list DataSource from SharePoint.

Add Rating List from SharePoint as DataSource.

So that patch function can use this data source to store the ratings.

 Rating List

Insert

Step 5. DisplayMode property of Rating Control.

DisplayMode property of rating control at Article description page and views gallery.

DisplayMode

Step 6. Default property of Rating Control.

Default property of Rating control.

Default property

Step 7. OnSelect property of Rating Control.

Below OnSelect property function is optional in case it is needed. In my case, it is not required as the rating control is in view mode.

OnSelect property

Step 8. Create a new screen and a new form to show view details.

It is an illustration of an alternative rating control technique. This screen will show us a little more detail of what we saw in the screen above. In this case, rating control validations will be observed.

 View details

Step 9. Add Rating Control to record ratings. Default Property of Rating Control.

The procedures for adding rating control and setting the default value to 0 are as follows. In contrast to the above, the validations will determine the display mode here.

The identical functionality described above will be present on a form where users can examine all of the item's details before selecting how to rate it. As a result, we'll include a rating control on the form below that displays your own ratings together with the total and average ratings as well as a patch of the ratings.

Patch

Step 10. Display mode will work depending on the validations.

Below is another example with validation to set Display mode.

Validation

Step 11. OnSelect of Rating Control.

Since I have handled the displaymode, It is not required to do validation on OnSelect so I am patching directly to the list.

Rating Control

Conclusion

The aforementioned example demonstrated how to apply rating control and how the information would be kept in a SharePoint list. In the case of a people-oriented software, it is a helpful scenario. Apps that are socially interactive frequently employ this functionality.


Similar Articles