cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
riveroalbert
Level: Powered On

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
PowerApps Staff CarlosFigueira
PowerApps Staff

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
PowerApps Staff CarlosFigueira
PowerApps Staff

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

riveroalbert
Level: Powered On

Re: Dropdown for ranking a gallery with integer numbers

Smart! Thanks 🙂

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 113 members 5,175 guests
Recent signins:
Please welcome our newest community members: