cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate II
Advocate II

Total amount of items in gallery

User enters data on a from that will be displayed on a gallery. I have one input box named "ID" and I would like that input to be auto filled with the total amount of items in the gallery + 1. Is there a way to call the total amount of items in the gallery?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Anonymous
Not applicable

You can use CountRows to get the number of items.

 

To get the number of items in gallery put the same formula in the CountRows() like you have in Gallery.Item

 

For example in gallery Item you have this forumla:

 

Filter(DataSource,Name = "Martynas")

To get the number of items in this gallery you would use:

CountRows(Filter(DataSource,Name="Martynas"))

The output of CountRows is number 

View solution in original post

HI @ShanP

@Anonymousis correct in his suggestion, but a more efficient formula that avoids an extra call to the database is this:

CountRows(Gallery1.AllItems)

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

You can use CountRows to get the number of items.

 

To get the number of items in gallery put the same formula in the CountRows() like you have in Gallery.Item

 

For example in gallery Item you have this forumla:

 

Filter(DataSource,Name = "Martynas")

To get the number of items in this gallery you would use:

CountRows(Filter(DataSource,Name="Martynas"))

The output of CountRows is number 

View solution in original post

HI @ShanP

@Anonymousis correct in his suggestion, but a more efficient formula that avoids an extra call to the database is this:

CountRows(Gallery1.AllItems)

View solution in original post

both suggestions work but the latter one only works first time For me.

If i want to make a change to my filter using a radio button for example, then i need to re-query the database each time to to get the countrow answer.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,968)