cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Dropdown for ranking a gallery with integer numbers

Hello, 

I have a gallery that can have different number of rows.  I need to be able to rank the different records being displayed on the gallery with a dropdown that contains as many integer numbers as number of rows (1, 2, 3, 4....). 

I'm struggling to define the dropdown "Items" (the allowed integer values you can chose ["1", "2", "3"....]) which will depend on the number of rows in the gallery. 

I've used CountRows and Gallery.AllItems to calculate the number of rows in the Gallery. So that is the "Maximum" value you need to be able to chose from the dropdown.. But how do I concatenate to add from 1 to the maximum number? Any Loop function available? 

 

Example: This gallery has 4 rows. So the dropdown options should be 1,2, 3 and 4. 

Captura.JPG

 

 

 

 

But the number of rows can change, so the available dropdown options should change too. 

 

Should be easy to make it work... I just can't figure it out! Thanks 🙂 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Apps
Power Apps

Re: Dropdown for ranking a gallery with integer numbers

You can use an expression like this one to create the Items property of your dropdown inside the gallery:

FirstN([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20], CountRows(MyOptions))

Where MyOptions is the collection that is used in the Items property of the gallery. You cannot reference Gallery.AllItems inside the gallery itself as it may create a circular reference which is not allowed.

The attached app shows this expression for your scenario. To open it, save it locally, then go to https://create.powerapps.com, select Open -> Browse, and find the file that you saved.

Hope this helps!

View solution in original post

2 REPLIES 2
Highlighted
Power Apps
Power Apps

Re: Dropdown for ranking a gallery with integer numbers

You can use an expression like this one to create the Items property of your dropdown inside the gallery:

FirstN([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20], CountRows(MyOptions))

Where MyOptions is the collection that is used in the Items property of the gallery. You cannot reference Gallery.AllItems inside the gallery itself as it may create a circular reference which is not allowed.

The attached app shows this expression for your scenario. To open it, save it locally, then go to https://create.powerapps.com, select Open -> Browse, and find the file that you saved.

Hope this helps!

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Dropdown for ranking a gallery with integer numbers

Smart! Thanks 🙂

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (5,649)