cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dandre
New Member

How to cut the file format from the file name (x-ms-file-name-encoded)?

Dear Power Automate Communtiy,

 

i am currently working on a flow. 

If a file is created -> Send E-Mail V2

 

The flow itself is working flawless - my last issue is the following: 

 

In the Subject i need the file name of the created file, but without the file format. 

Basically my subject is always "TEST: Testfile.pdf ABC" - how can i remove ".pdf" from the filename dynamic content?

 

Dandre_0-1656405804412.png

 

Any help is appreciated 🙂

Dandre

1 ACCEPTED SOLUTION

Accepted Solutions
MarconettiMarco
Resident Rockstar
Resident Rockstar

Hello @Dandre ,

you can Initialize a variable of String type (I've named it "FileName"), adding the file name as value:

MarconettiMarco_0-1656408272903.png

 

Then add a Compose action in which you have to add the following expression:

 

substring(variables('FileName'),0,sub(length(variables('FileName')),3))
MarconettiMarco_1-1656408342734.png

 

Then, in the email subject you should add the Compose outputs.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

 

BR,

Marco

View solution in original post

3 REPLIES 3
MarconettiMarco
Resident Rockstar
Resident Rockstar

Hello @Dandre ,

you can Initialize a variable of String type (I've named it "FileName"), adding the file name as value:

MarconettiMarco_0-1656408272903.png

 

Then add a Compose action in which you have to add the following expression:

 

substring(variables('FileName'),0,sub(length(variables('FileName')),3))
MarconettiMarco_1-1656408342734.png

 

Then, in the email subject you should add the Compose outputs.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

 

BR,

Marco

Dear Marco,

Thank you for the quick help - worked out perfectly.

Best regards

Hi @Dandre ,

 

split(variables('test1'),'.pdf')
you can define your variables here instead of test1
Ahammad_Riyaz_0-1656409695046.png

 

Ahammad_Riyaz_1-1656409863488.png

 

Here if u pass 

outputs('Compose')[0]
You will get the filename.
 

Regards

Ahammad Riyaz

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,894)