cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Make Rating Mandatory

Hi, 

 

I have a star rating system from 1-5, when we refresh the page the ratings should clear and be set to the default of 0. However we do not want anyone to skip those questions and output a rating of 0 so would like the button to move to the next page to be disabled when the rating is 0 (rating not filled in). 

 

Any help would be great. 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Make Rating Mandatory

Hi @Anonymous

 

Assuming that your button calls the Navigate function, you can wrap this in a conditional statement to prevent the navigation when the rating value is 0. The formula would look something like this:

 

If(Rating1.Value <> 0, 
    Navigate(YourOtherScreen, ScreenTransition.Cover), 
    false
)

 

View solution in original post

6 REPLIES 6
Highlighted
Super User III
Super User III

Re: Make Rating Mandatory

Hi @Anonymous

 

Assuming that your button calls the Navigate function, you can wrap this in a conditional statement to prevent the navigation when the rating value is 0. The formula would look something like this:

 

If(Rating1.Value <> 0, 
    Navigate(YourOtherScreen, ScreenTransition.Cover), 
    false
)

 

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Make Rating Mandatory

Thanks for the reply. 

 

The button actually patches to my SP list rather than Navigate. 

 

Can I use 

If(Rating1.Value <> 0,

 part of the code to prevent the patch? 

 

Highlighted
Super User III
Super User III

Re: Make Rating Mandatory

Yes, you can use that syntax to prevent the patch.

Highlighted
Anonymous
Not applicable

Re: Make Rating Mandatory

Hi would the code be like this: 

 

If(Rating1.Value<>0, Patch(
    SPList,Defaults(SpList),
    {Columnname:Dropdownname.Selected.Value}
   )),false

Not sure if this is right?

 

Highlighted
Super User III
Super User III

Re: Make Rating Mandatory

I think your closing bracket is in the wrong place, but assuming that your rating control is called Rating1, then this code should work.

 

If(Rating1.Value<>0, 
Patch(SPList,Defaults(SpList), {Columnname: Dropdownname.Selected.Value} ),
false
)
Highlighted
Anonymous
Not applicable

Re: Make Rating Mandatory

Thanks, got it working so that it won't navigate or patch when the rating is 0. 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (8,072)