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

Dropdown for ranking a gallery with integer numbers

(0) ShareShare
ReportReport
Posted on by

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
    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
    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

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard