web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Handling empty fields ...
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?
form screenshot.jpg
Categories:
  • ronaldwalcott Profile Picture
    3,914 Moderator on at
    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.
  • Suggested answer
    Mark Nanneman Profile Picture
    993 Moderator on at
    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.

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 226 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 191 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 167

Last 30 days Overall leaderboard