Skip to main content

Notifications

Community site session details

Community site session details

Session Id : Efw2OnYb3x6SymlXYOfyts
Power Automate - Using Flows
Answered

Sharepoint filter by file type/extension

Like (1) ShareShare
ReportReport
Posted on 13 Dec 2018 18:00:52 by

Hi,

I'm trying to create a flow to get only some files.

How can I filter by docx, doc, xls, xlsx, ppt, pptx?

Thanks.

  • OscarMartinez Profile Picture
    4 on 14 Aug 2023 at 06:14:36
    Re: Sharepoint filter by file type/extension

    thanks @anton-khrit, this worked like a charm.

  • Dawidvh Profile Picture
    1,346 on 29 Oct 2022 at 04:05:45
    Re: Sharepoint filter by file type/extension

    Hello @AngelPA, This is an internal property name of SharePoint. There are two others as well:

    FileLeafRef = Name of the file
    FileRef = Relative URL path to the file

  • AngelPA Profile Picture
    5 on 18 Mar 2022 at 20:06:36
    Re: Sharepoint filter by file type/extension

    how you identify that the name of the fild is "File_x0020_Type"?

  • Community Power Platform Member Profile Picture
    on 19 Jul 2019 at 17:18:31
    Re: Sharepoint filter by file type/extension

    @anton-khrit-hq 

    Your solution works perfectly, and is faster.

    Thank you.

     

    How can I run this in a specific folder inside "Shared Documents"?

  • Verified answer
    anton-khrit-hq Profile Picture
    13 on 20 Jun 2019 at 12:45:45
    Re: Sharepoint filter by file type/extension

    This should work for you:

    File_x0020_Type eq 'xls' or File_x0020_Type eq 'doc' or File_x0020_Type eq 'ppt'

     

    I didn't test it.

  • Community Power Platform Member Profile Picture
    on 18 Jun 2019 at 15:09:29
    Re: Sharepoint filter by file type/extension

    @anton-khrit 

    Yes I noticed that takes too long because we have multiple files.

    With your solution, how can I search for xls, doc, ppt in the same filter? It's possible?

  • Verified answer
    anton-khrit Profile Picture
    197 on 18 Jun 2019 at 09:50:24
    Re: Sharepoint filter by file type/extension

    Hi!

     

    There is a better and more effecient way to do this. Filtering result array is time consuming for thouthands of documents.

     

    Just use this oData filter under Advanced section of the "Get files" action:

    File_x0020_Type eq 'xls'

     

    You can find example of usage in this article.

     

    This approach is better because it returns only required files.

     

  • Community Power Platform Member Profile Picture
    on 14 Dec 2018 at 18:16:12
    Re: Sharepoint filter by file type/extension

    Barry,

    It works.

    Thank you.

  • Verified answer
    v-bacao-msft Profile Picture
    on 14 Dec 2018 at 03:58:54
    Re: Sharepoint filter by file type/extension

    Hi @Anonymous,

     

    You could get all files information first by using Get files(properties only).

    Then use Filter array to filter files, if the file name with the extension ends with the expected file format.

    Use endswith() function to make a decision.

    Formula reference:

     

    @or(endswith(item()?['{FilenameWithExtension}'], '.docx'),endswith(item()?['{FilenameWithExtension}'], '.doc'),endswith(item()?['{FilenameWithExtension}'], '.xls'),endswith(item()?['{FilenameWithExtension}'], '.xlsx'),endswith(item()?['{FilenameWithExtension}'], '.ppt'),endswith(item()?['{FilenameWithExtension}'], '.pptx'))

    Image reference:

    30.PNG

    Please take a try.

     

    Best Regards,

    Barry

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Using Flows

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 9 Super User 2025 Season 1

#2
rzaneti Profile Picture

rzaneti 7 Super User 2025 Season 1

#3
lbendlin Profile Picture

lbendlin 4 Super User 2025 Season 1

Overall leaderboard

Featured topics

Restore a deleted flow