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
}
)
)
))
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.
WarrenBelz
146,751
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional