I can't get the file extension after Flow sends me an email. I searched through the web and saw that I can use metadata, but after I added metadata, there's a condition but the expression for the condition won't work at all.


I saw they used to have the advanced function but it's not available anymore. I cant add it in the expression either, as it's invalid.

Is there another way I can get the file extension in my email attachment?

Thanks in advance.

  • 1
    Are you retrieving the file content and properties from a SPO library and sending that as an email attachment? If you are reading file meta data properties, you can get the file extension from File name with extension outputs('Get_file_properties')?['body/{FilenameWithExtension}'] – Matiur Rahman Dec 29 '20 at 16:55
  • Yes, im trying to do that as my email attachment is without any extension which is hard for me to choose the program to open the file. – Melv Dec 30 '20 at 11:56
  • I think mine is retrieve from onedrive instead of SPO. sorry for the confusion. Now im only got parsejson -> get file content from path -> send email. So if i want the extension from my onedrive, how can i do that? – Melv Dec 30 '20 at 12:31
  • Let me check on that (OneDrive). will post my response as soon as I can – Matiur Rahman Dec 30 '20 at 15:45

Not sure about the exact requirements, but the following example shows how to get files from OneDrive and send those files with file extensions as an email attachment.

Please see the screenshots and explanation below.

enter image description here

Detail 1

enter image description here

Detail 1.1

enter image description here

Expressions used from the Dynamic Content

Id: items('Apply_to_each')?['Id']

Display name: items('Apply_to_each')?['DisplayName']

File content: outputs('Get_file_content')?['body']

Detail 2

enter image description here

The final output

enter image description here


Similar way, we can attach multiple files from SPO document library

  • Thanks Rahman. But i got errors in step detail 1.1. It said enter a valid json. I got a few questions here: 1. in detail 1.1, the 3 expression used is select from dynamic content or i type in expression? 2. In detail 1, under condition for no, i put nothing? – Melv Dec 31 '20 at 3:14
  • You got error in step 1.1 for [Get file content] or [Send and email] action? You don't have to type in the expressions, you could select those values from the Dynamic content. I've shown the expressions for reference purpose only. For condition, in this case, that is, Is folder?, you need to put "true" in the expression panel and then click "OK" as we're processing files only. – Matiur Rahman Dec 31 '20 at 4:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.