Skip to main content

Notifications

Power Automate - General Discussion
Answered

Find Files in Folder by Path

(0) ShareShare
ReportReport
Posted on by 276

Hello.

 

I'm trying to determine if a file Exists or not in a directory (folder).

I know the folder is EMPTY...nothing in it.  However a similar file name is in a different directory...why is it picking up a file in a different directory when it should be returning NOTHING or Zero Files???  See screen shot:

 

I know the TEMP folder is EMPTY...however you can see from the screen shot below it found a file in a totally different directory???

 

2022-12-09_16-17-15.png

  • Verified answer
    Ellis Karim Profile Picture
    Ellis Karim 10,517 on at
    Re: Find Files in Folder by Path

    Hi @smithmrk ,

     

    It seems that the Find files in folder by path action also searches within subfolders - i.e. folders underneath /1099/TEMP.

     

    You may be able to get away with using Pattern for the File Search Mode, then filter the results, filtering for the exact file path and filename?  Using OneDriveSearch for the File Search Mode doesn't return the full path of the file so we can't filter the files based on the path.

     

    Snag_139387c8.png

     

    In the sample results below, note the two paths as returned by the Pattern search mode:

     

     

     

     {
     "Id": "b!nzu48wrMZk6wUa2mtk43v-BAQOSBY366FHKIOJSAKCX54C4",
     "Name": "Test1.docx",
     "NameNoExt": "Test1",
     "DisplayName": "Test1.docx",
     "Path": "/1099/TEMP/Test1.docx",
    
    {
     "Id": "b!nzu48wrMZk6wUa2mtk43v-F8iPoxJAxKiXUPzIa7meKD4I4K",
     "Name": "Test1.docx",
     "NameNoExt": "Test1",
     "DisplayName": "Test1.docx",
     "Path": "/drives/b!nzu48wrMZk6wUa2mtk43v-F8iPoxJAxKiXUPzIa7meKhmZ2_IOOwTJX7DMvB0_J0/root:/1099/TEMP/sub1/Test1.docx",
    

     

     

     

     

    Snag_13951146.png

     

    Hope this helps.


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard