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 / Looping through nested...
Power Apps
Answered

Looping through nested gallery checkboxes

(0) ShareShare
ReportReport
Posted on by 51

Hi,

I am making a survey app and I have made my own checkbox control using a gallery since one doesn't exist natively.

When the user saves/submits, I need to loop though all checkboxes within the galCheckbox_CS gallery, which is within the main galSurveyForm_CS gallery, and then save the properties to a new row in a collection when the checkbox is selected. 

 

However, the ForAll(galCheckbox_CS.AllItems As _item loop is not running. I have tried it inside and outside the collect function. I have replaced the collection contents with dummy data.  I have removed all other logic. It still will not work. 

Any help would be appreciated.

Thank you.

 

 

 

 

 

ForAll(galSurveyForm_CS.AllItems,

If(ThisRecord.QuestionType = "Checkbox" || ThisRecord.QuestionType = "CheckboxDynamic",
Collect(_SavedSurveyResponsesCollection_CS,
ForAll(galCheckbox_CS.AllItems As _item,
If(_item.chkCheckboxSelection_CS.Value,
{
ModifiedResponseID: locCurrentModifiedResponseID,
QuestionID: ThisRecord.QuestionID,
Response: _item.QuestionOptionText,
ResponseShort: _item.QuestionOptionShortText,
ResponseValue: _item.QuestionOptionValue,
ResponseEntryDate: _CurrentDateTime_CS,
ResponseID: locCurrentResponseID
}
)
)
))

 

 

 

 

Screenshot 2023-01-15 154639.png

Categories:
  • Verified answer
    kris_cs1 Profile Picture
    51 on at

    Actually, I found another post that said to add a label with CountRows(galCheckbox_CS.AllItems) within the parent gallery, which solved the issue. Definitely seems like a bug.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard