web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / odata query filter on ...
Power Automate
Answered

odata query filter on Get files(Properties only)

(0) ShareShare
ReportReport
Posted on by 163
Hi, 

I am trying to build a workflow that picks up any email received in a users Inbox where the subject contains the string "Project - 9999 - " (Where 9999 could be any number)  and then stores that email into a Project folder in a document library. 

The document library contains hundreds of folders each starting e.g.  "Project - 1234 - project title".

I have got the workflow to intercept the email and extract the search string into a Compose action.  I am then trying to identify the specific folder required by using this Get Files action
 

 
The FSObjType eq 1 part of the Odata query works fine on its own and returns all the folders however the startswith part of the query doesn't seem to work. I've even tried just hardcoding "startswith(Title,'Project - 1234 - ') and that doesn't return the folder even though I can actually see it. 

I was referencing this very helpful url regarding syntax - OData: startswith Function - Manuel T. Gomes
but still no joy.

Any ideas?  
 
Categories:
I have the same question (0)
  • Verified answer
    Riyaz_riz11 Profile Picture
    3,893 Super User 2025 Season 2 on at
    Hi,
     

    Option 1: Use Filter array after retrieving all folders

    Instead of relying on OData filter in the Get Files action (which can be limited), retrieve all folders first, then filter them in Power Automate.

    Steps:

    1. Use Get Files (Properties only) action

      • Filter query: FSObjType eq 1 (to get all folders)

    2. Add Filter array action

      • From: output of Get Files

      • Condition: Use expression to filter folder names starting with your project string

    Example condition expression:

    startsWith(item()?['Title'], outputs('Compose_ProjectString'))
     

    Where outputs('Compose_ProjectString') contains your project string like "Project - 1234 - ".

    1. The Filter array will return matching folders.

    Option 2: Use SharePoint REST API call with Send an HTTP request to SharePoint

    The SharePoint REST API supports startswith in $filter properly.

    Example HTTP request:

    • Site Address: Your site URL

    • Method: GET

    • Uri:

    _api/web/lists/getbytitle('Documents')/items?$filter=FSObjType eq 1 and startswith(Title,'Project - 1234 - ')
     

    You can replace 'Documents' with your document library name.

    Then parse the JSON response to get your folder.


    If I have answered your question, please mark it as the preferred solution ✅ . If you like my response, please give it a Thumbs Up 👍.
    Regards,
    Riyaz
  • Ian_C Profile Picture
    163 on at
    Many thanks @Riyaz_riz11
    Your Option 1 has worked a treat.
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard