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 / Dropdown for ranking a...
Power Apps
Answered

Dropdown for ranking a gallery with integer numbers

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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 🙂 

 

Categories:
I have the same question (0)
  • Verified answer
    CarlosFigueira Profile Picture
    Microsoft Employee on at

    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!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Smart! Thanks 🙂

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 600

#2
WarrenBelz Profile Picture

WarrenBelz 478 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard