Skip to main content

Notifications

Power Automate - General Discussion
Answered

Check if a file name already exists in a SharePoint folder

(0) ShareShare
ReportReport
Posted on by 69

I have a workflow that needs to check to see if an email attachment has already been uploaded to a specific SharePoint folder. I need it to check for the filename without extension.

 

I have tried a few different things , without success.

 

Currently I am using the Get Files (properties only) action. *I then have a filter array, filtered to see if the Get Files dynamic value "Name" is equal to the Outlook Attachment Name (trimmed to remove the extension) *Then I am taking the length of the filter array to see if it equals 0

If it equals 0, it will create the file in the folder If it is not equal to 0, it means the file already exists and it will not create the file in the folder

 

Results: The flow isn't performing as expected and instead is resulting in everything being a new file and creates it in the folder. It's not looking just for the file name, it's looking at the file extension as well  (which I don't want to do) Some users might upload with .xlsx and others with .xls , so we only care about the file name.

 

Ckatz_1-1655137569330.png

 

 

 

 

  • Verified answer
    Ckatz Profile Picture
    Ckatz 69 on at
    Re: Check if a file name already exists in a SharePoint folder

    I figured out another way to make this work. I replaced the SharePoint Get Files (properties only) action with the SharePoint List Files action.

    Ckatz_0-1655150279298.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

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,508

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,839

Leaderboard