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 / Nested Gallery - Help ...
Power Apps
Answered

Nested Gallery - Help Validating Required question is answered

(0) ShareShare
ReportReport
Posted on by 17
Hi All,
 
I have a gallery with survey questions each of the questions are mandatory, based on the responses selected I am using a nested gallery inside the Parent gallery which becomes visible only if a certain response is selected in parent gallery. I need to add a validation that when all the questions are answered then only I submit button should be visible.I am able to do add this validation for Parent gallery but the same doesn't work for questions in nested gallery. Please help.
Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,921 Most Valuable Professional on at
    Hi @SH3R
    A bit messy (and watch for the order of resolution of the labels) and I am assuming checkboxes here (you will need the change the filter (blue part) depending on how you determine the child gallery complies) - but if you put a label inside the main gallery with
    If(
       ChildGallery.AllItemsCount = 
       CountRows(
          Filter(
             ChildGallery.AllItems,
             CheckboxName.Value
          )
       ),
       1,
       0
    )
    it will display the value 1 if all questions are answered (and zero if not). You then need a second label outside the gallery with
    Sum(
       ParentGallery.AllItems,
       Value(FirstLabelName.Text)
    )
    and then need to test for
    ParentGallery.AllItemsCount = Value(YourSecondLabel.Text)
    it should only be true if all questions are answered in the child galleries.
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    Buy me a coffee
  • SH3R Profile Picture
    17 on at
    Hi WarrenBelz,
     
    I am using Radio button in Parent gallery and the visibility of Nested Gallery is dependent on the response select in Parent Gallery. The way I am handling the validation of Parent Gallery is similar to your approach, I have added a hidden label on Parent Gallery which has Text, Answered or Unanswered based on condition whether a response is selected in the gallery or not then on submit button I am doing a filter on ParentGallery.AllItems and checking for label values are not unanswered.
     
    I tried the same approach for nested gallery but the countrows was returning blank for Nested Gallery.Allitems so for troubleshooting I Saved gallery all items to a collection then I was able to get a value in CountRows but it was always showing Unanswered value for label even when on screen I could see everything as unanswered.
     
    I would try this approach to referencing the Unanswered and answered value on Parent Gallery for both Nested Gallery and Parent Gallery and then using it to filter on submit button. Thanks for the help, I'll let you know how it goes.
     
  • SH3R Profile Picture
    17 on at
    Thank you so much! I have been pulling my hair entire day and was confused the way collections and countrows were behaving referencing the nested gallery. Solved using your method of validating in the parent gallery itself.

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 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard