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 Automate / Checking if a file alr...
Power Automate
Unanswered

Checking if a file already exist from the start of the naming

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi All,

 

I have created a flow that checks if a file already exist in a folder, and if so it move it and replaces it with the new file which works fine. However, rather than checking against the whole file name I would like to check if a file already exist in a folder based off the start of the naming as the first 7 character will never change i.e. ABC 227. For example :

 

Current file: ABC 227 02 Testing Document

New file:      ABC 227 03 Testing Document

 

What my flow is currently doing is treating it as separate document which i can understand, but regardless of whatever the second number is i would like it to treat it as the same document and move the ABC 227 02 Testing Document document and replace it with ABC 227 03 Testing Document rather than having them together in the library.

 

Example of the flow:

ArturDj_0-1629723237498.png

 

Thank you

 

 

 

 

 

Categories:
I have the same question (0)
  • eric-cheng Profile Picture
    5,171 on at

    Hi @Anonymous ,

     

    Use substring to get the first 7 characters and match that in your condition

     

    @substring('ABC 123 02 Testing Document', 0, 7)

     

    Will return 'ABC 123'

     

    You will need to add some logic to get 02 and increment by one.  You could use substring again but the challenge will be if you get to three or four digits 

     

    E.g.ABC 123 200 Testing Document or ABC 123 2000 Testing Document

     

    --------------------------------------------------------------------------
    If I have answered your question, please mark my post as a solution
    If you have found my response helpful, please give it a thumbs up

    Connect on LinkedIn

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @eric-cheng,

     

    Thank you for the swift reply!

     

    Sorry i should of posted it in my original post that I have already played around with the 

    @substring('ABC 123 02 Testing Document', 0, 7). 

     

    I am just struggling on how to use this to carry out the check if that file already exists using the substring an using it to move the file it regardless of the second number.

     

    Thank you 

     

     

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 Automate

#1
David_MA Profile Picture

David_MA 77 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 68

#3
Expiscornovus Profile Picture

Expiscornovus 56 Most Valuable Professional

Last 30 days Overall leaderboard