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 / Predefining Variables ...
Power Apps
Unanswered

Predefining Variables for a Repeating gallery

(0) ShareShare
ReportReport
Posted on by

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

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    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

     

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