cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cs024
Frequent Visitor

Extract string from filename

hi there,

 

I was hoping someone can help me with an expression I can use to extract a string that is located within a filename.

 

For example, if the filename is JohnSmith_23_ABC_Hello.pdf, I'd like it to extract "ABC".

The location of "ABC" may not always be in the third position. 

Basically, I'd like it to "find" either the word "ABC" or "ABD" and if found, extract that and put it in a column (column is in a list)

I'm having problems finding an expression that will find out if the filename has an "ABC" or "ABD" :(.

 

Please help and thank you.

J

1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

Hi @cs024,

 

Here is an action named Condition, you could use it to check if filename contains ABC or ABD:Screenshot 2021-04-28 133503.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-litu-msft
Community Support
Community Support

Hi @cs024,

 

Here is an action named Condition, you could use it to check if filename contains ABC or ABD:Screenshot 2021-04-28 133503.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

cs024
Frequent Visitor

Thank you for your help. I guess I can do the check using a condition control. I was hoping I wouldn't have to nest conditions and use an expression instead but this should work. 

 

Thank you! 🙂

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (3,293)