Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Suggested answer

Handling empty fields in gallery before submitting to sharepoint

(0) ShareShare
ReportReport
Posted on by
I want to set the Submit button display mode to  disabled until the mandatory fields in each line of gallery is filled by the user. The group of mandatory fields will differ based on a drop down field "Type" where user will select values like [ Ad-hoc, Reccuring ] . Ad-hoc type will activate few fields and disable other field unrelated and vice versa.
 
Challenge: I believe, my if condition and countif(gallery.allitems, fieldvalidation count) > 0 is counting empty fields from other line items as well which ideally should count only from the particual line time only.
 
Any ways to achieve the desired result?
  • Suggested answer
    Mark Nanneman Profile Picture
    989 Super User 2025 Season 1 on at
    Handling empty fields in gallery before submitting to sharepoint
    Here's how I would tackle this one.  I would create a checkmark icon control (or it could be a toggle or text) that's inside each item in the gallery.  I would give it a formula so that it's only visible if all the required fields are filled out.  So it could be as simple as

    !IsBlank(DropdownCanvas1.Selected.Value)
     
    (And it could get more complicated if you have to check if other controls are filled out if they are in edit mode and/or visible based on the dropdown value.  Also, if using a toggle you could set the "Checked" value to this same formula)

    After this your submit button needs a displaymode formula like:
     
    If(CountRows(Filter(Gallery2.AllItems,ico_validation_check.Visible))=Gallery2.AllItemsCount,DisplayMode.Edit,DisplayMode.Disabled)

    Basically this gets a count of all the checkmark icons controls that are visible and checks if that matches the total count.

    Here's an example (Submit disabled because the first item in the gallery doesn't have a non-blank option selected in the drop down):


    Here the submit button is in edit mode because the drop down now has a selection.

     
  • ronaldwalcott Profile Picture
    3,820 on at
    Handling empty fields in gallery before submitting to sharepoint
    How do you determine which fields are mandatory?
    If each line is different then you could have a matching collection based on the number of rows in the gallery, Columns index, validated when row is validated set to 0, if not validated set to 1. Then if all rows add to 0 Submit can be enabled.
     
    You need to provide some more details.

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1