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 Automate
Unanswered

Filename format check

(0) ShareShare
ReportReport
Posted on by 73

Hi,
What is the best way to check of the format of a filename complies to a standard?

Our standard looks like this: BC1234-BAM-XX-XX-BQ-CN-0085.docx
(Project-Originator-Level-Location-Type-Role-Number)

Project is alphanumerical  6 characters
Originator is alphanumerical 3 characters
Level, Location, Type and role are alphanumerical 2 characters
Number has a minimum length of 4 characters (so below 1000 leading zero's are added)

I was thinking to use find to check if the - appears 6 times and  substring to check if they are on the right position
substring(variables('filename'), 6,1 ) should be a - sign.

I'm not sure how to put this together.


 

 

Categories:
I have the same question (0)
  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @rolanddaane 

     

    Flow doesn't yet support regular expressions, yet you can build something using Typescript/Office Scripts How to use Regex in Power Automate (tachytelic.net).  More recently, there is the option to create a C# Custom Connector, which might also suite your needs/requirements.

     

    If neither apply, you could use the expression split(string,'-').  It will return an array of objects split on the -.  You can then check each of the objects as you require?

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

     

  • rolanddaane Profile Picture
    73 on at

    I subscribed and already liked your intro video.
    Are you based in the UK?

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @rolanddaane 

     

    I am indeed - North East Scotland!

     

    Damien

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 711

#2
Vish WR Profile Picture

Vish WR 691

#3
Haque Profile Picture

Haque 525

Last 30 days Overall leaderboard