Skip to main content
Community site session details

Community site session details

Session Id : VsV6+uQwze54XhBO5f4HTw
Power Apps - Building Power Apps
Answered

Complex validation on a repeating section inside a Canvas App - how to highlight individual errors

Like (1) ShareShare
ReportReport
Posted on 21 Apr 2025 14:45:10 by 4

I have a repeating section implemented as a gallery to collect rows of data from users.

Each row has fields like "Quantity", "Price", and "Date". I want to:

  • Highlight rows in red if any required field is blank
  • Prevent submission if any errors exist

How can I do row-level validation in a gallery?

Categories:
  • Verified answer
    vipuljain03 Profile Picture
    497 Super User 2025 Season 2 on 21 Apr 2025 at 20:07:52
    Complex validation on a repeating section inside a Canvas App - how to highlight individual errors
    You can implement row-level validation using ForAll, Collections, and conditional formatting.
     
    1. Add a field to your collection to track row-level errors:
    ForAll(
       colItems,
       Patch(colItems, ThisRecord, {
           HasError: IsBlank(Quantity) || IsBlank(Price) || IsBlank(Date)
       })
    )

    2. In your gallery template, add conditional formatting: Fill = If(ThisItem.HasError, Color.Red, Color.White)
     
    3. Before submission, check:
    If(
    	  CountIf(colItems, HasError) > 0,
    	   Notify("Please correct highlighted rows", NotificationType.Error),
    	   SubmitForm(Form1)
    )
    You can even use icons to indicate error per row (Visible = ThisItem.HasError).
     
    Check also:
    ----------------
    If this reply helped you, please mark this reply as suggested answer ✔️ and give it a like to help others in the community find the answer too!
    Thanks,
    Vipul
  • stampcoin Profile Picture
    3,893 Super User 2025 Season 2 on 21 Apr 2025 at 15:56:38
    Complex validation on a repeating section inside a Canvas App - how to highlight individual errors
    some suggestion:
    1. Use the collection for the gallery until it's validated then patch.
    2. Use TemplateFill to tint rows red when Quantity, Price or Date is blank.
    3. Disable the Submit button if has invalid rows.
    4. Optionally add inline icons/messages per field for extra clarity.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete