cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AK7
Frequent Visitor

Count number of rows in current gallery view.

Is there a way to count rows in the current gallery view. 

With COUNTROWS, I can count total rows in my SharePoint List but I just want to count number of rows currently present in the gallery (i.e. after I have applied my filters).

Any help would be well appreciated

 

1 ACCEPTED SOLUTION

Accepted Solutions
BitLord69
Power Participant
Power Participant

Just call CountRows with Gallery.AllItems, like this: 

 

CountRows(gMyGallery.AllItems)

Good luck!

View solution in original post

5 REPLIES 5
BitLord69
Power Participant
Power Participant

Just call CountRows with Gallery.AllItems, like this: 

 

CountRows(gMyGallery.AllItems)

Good luck!

View solution in original post

Meneghino
Community Champion
Community Champion

Fully agree with @BitLord69, but just be careful with paging.

A gallery will only load the first 100 items initially and will load the next batch of 100 items if you scroll down to the end of the current list.  It will do this four times to retrieve a maximum of 500 items.

At least this was true about a month ago when I last checked.

Hi Bitlord. Question: How do you count based per a value ? Each item in my gallery has a status field, pending or done. I would like to count only the pending ones.

Thanks

AK7
Frequent Visitor

Hi Babulau,

Use CountRows(Filter(GalleryComponent.AllItems,(Status = "Pending")))

GalleryComponent is the gallery name.
Status is the column name

 

Best,
Ak

This can be abbreviated to CountIf(GalleryComponent.AllItems, Status = "Pending")

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (4,061)