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 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.
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.
P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉
Learn how to create your own user groups today!
Check out the new Power Platform Community Connections gallery!
Congratulations, the new Super User Season 2 for 2021 has started!
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.