
Announcements
Hi all,
I have a repeating gallery based on a list box. The more items in the listbox a user selects, the more rows are added to a collection. The collection is then viewed on a gallery where users can add additional details which is then submitted at the end of the page.
My code looks like this to get that all to happen (based on another post). The variable following "Sequence" is the number of rows selected in the listbox, by the way.
ForAll(Sequence(yourtotalNominationsAllowed_Variable) As totalNominationsAllowed, Collect(colNominations, {Id: totalNominationsAllowed.Value, yourColumn1: Blank(), yourColumn2: Blank()}))
What I can't get my head around is how would I map what is selected for each item in the listbox to each new row added in the repeating gallery? I was thinking of defining what is selected as a collection and then looping through that collection somehow, but having trouble thinking how I would do that.
TY
Hi @shuhn1229 ,
I am a bit unclear why this does not work if I understand your requirement properly - this code (the As statement is not really needed)
ForAll(
Sequence(yourtotalNominationsAllowed_Variable),
Collect(
colNominations,
{
Id: Value,
yourColumn1: Blank(),
yourColumn2: Blank()
}
)
)
assuming yourtotalNominationsAllowed_Variable is a number will create that number of records in colNominations with the Id field containing a count (from 1 to the number) and the other two field blank. Is this not happening ?
Please click Accept as solution 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 Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps