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 / Get count of gallery d...
Power Apps
Answered

Get count of gallery document format in a label

(0) ShareShare
ReportReport
Posted on by 531

I have a powerapp gallery with SharePoint document library as the datasource.

 

Gallery Items Property

Filter(
 Documents,
 'Folder path' = "Shared Documents/Finance/" &DataCardValue3_2.Text&"/" 
)

 

Gallery Label

ThisItem.'FileNameWithExtension'

 

I need to get count of the documents in gallery whose file extension is pdf/pptx/docx/xlsx. May i know how to achieve this?

 

Categories:
I have the same question (0)
  • wolenberg_ Profile Picture
    1,158 Super User 2026 Season 1 on at

    Hello @Iantaylor2050 ,

    You can create a If statement to count the files filtering the ending sufix

    Something like this:

    If(EndsWith( FileNameWithExtension, "pdf" ),Collect(colPdfs,ThisItem))
    
    Set(varTotalPdfs, CountRows(colPdfs))

     

    And the same for the rest of extensions that you got.

     

    -------------------------------------------------------------------

    If my reply helped you, please give a 👍
    If it solved your issue, please give a 👍 & accept it as the Solution to help other community members find it.

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    HI @Iantaylor2050,

    Set the Label text property as:

    CountIf(Gallery4.AllItems,Last(Split(Label_Extension.Text,".")).Value in ["pdf","pptx","docx","xlsx"])

    vqiaqimsft_0-1710478389885.png

     

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!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 85

#2
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard