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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Handling empty fields ...
Power Apps
Unanswered

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?
Categories:
I have the same question (0)
  • ronaldwalcott Profile Picture
    3,847 Super User 2025 Season 2 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
    991 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard