cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
janineb
Helper I
Helper I

Blank field error checking in PowerApps

Good day,

I have a Canvas app where people need to rate on various categories (using the rating stars feature in PowerApps).  All the ratings are mandatory and I would like to show an error message if a rating category is omitted.  However, I cannot get this to work.  The Patch function works 100%, but the "IsBlank" and Error notification message do not work.  Your assistance would be appreciated.  Here is my code for the app:

 

//No Rating Error
UpdateContext({varNoRatingError:
If(IsBlank(Quality1);true;false)});;
//Error Message
If(varNoRatingError;Notify("Please rate all the categories"; NotificationType.Error);

Patch(SubmissionRatings; Defaults(SubmissionRatings); {Date: DatePicker1.SelectedDate; Topic: Dropdown4.SelectedText.Value; Committee: Dropdown2.SelectedText.Value; Assessor: AssessedbyTxt.Text; Quality1: Quality1.Value; BusinessCase2: BusinessCase2.Value; RiskMitigation3: RiskMitigation3.Value; Fitness4: Fitness4.Value; QualitySupport5: QualitySupport5.Value; TeamPerformance6: TeamPerform6.Value; OverallRating: Value(OverallAveTotalLbl.Text); Comments: CommentsTxt.Text; Quality1ValueLbl: Value(Quality1ValueLbl.Text); BusinessCase2ValueLbl: Value(BusinessCase2ValueLbl.Text); RiskMitigation3ValueLbl: Value(RiskMitigation3ValueLbl.Text); Fitness4ValueLbl: Value(Fitness4ValueLbl.Text); QualitySupport5ValueLbl: Value(QualitySupport5ValueLbl.Text); TeamPerformance6ValueLbl: Value(TeamPerformance6ValueLbl.Text)}))

 

janineb_0-1636097442494.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
PTBBSolutions
Solution Supplier
Solution Supplier

Hi @janineb ,

 

The rating control always has a value so it will never be blank. Instead, try 

UpdateContext({varNoRatingError:
If(Quality1.Value = 0;true;false)})

View solution in original post

2 REPLIES 2
PTBBSolutions
Solution Supplier
Solution Supplier

Hi @janineb ,

 

The rating control always has a value so it will never be blank. Instead, try 

UpdateContext({varNoRatingError:
If(Quality1.Value = 0;true;false)})

Thank you!  Working perfectly!  Much appreciated

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (5,262)