cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
yoshihirok
Level 10

Error at Mail attachment file to create a file in File System.

I want to save attachement file from a new mail to File System.

 

My Flow:1.png

 

 

 

- Trigger : Outlook for Business - When a new mail arrives

- Apply to each - attachements

  - Action: Microsoft Teams - Alert the team ( message : Subject )

  - Action: File System - Create file ( file name : Name, file content : Content )

 

Error details:

Unable to process template language expressions in action 'Create_file' inputs at line '1' and column '2086': 'The template language function 'base64ToBinary' expects its parameter to be a string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#base64ToBinary for usage details.'

2.png

 

 

 

I want to save attachment files to on-premises file server.

 

Regards,

Yoshihiro Kawabata

1 ACCEPTED SOLUTION

Accepted Solutions
Power Automate Staff TravisB
Power Automate Staff

Re: Error at Mail attachment file to create a file in File System.

Hi @yoshihirok,

 

In addition to "Has Attachment" you're also going to want to check "Include attachment."

 

"Has attachment" makes it so that the flow only triggers on emails that have attachments. This is good to have for your use case since you're only interested in emails with attachments and you don't want to trigger a bunch of flows for things you don't care about.

 

"Include attachment" is what actually includes the attachment content. Without that you just get some metadata about the attachments, not the actual content.

 

Hope this helps!

 

Best,

Travis

View solution in original post

4 REPLIES 4
Microsoft Employee

Re: Error at Mail attachment file to create a file in File System.

Hi @yoshihirok,

 

Did you specify that you wanted to include attachments in the trigger? If no, please try that. If yes, could you try adding a condition to skip the attachment if it is null?

 

Thanks,

Shubham

yoshihirok
Level 10

Re: Error at Mail attachment file to create a file in File System.

Hi @ShubhamGogna

 

I re-check this issue with "Has Attachement" = "Yes" in Trigger "When a new mail arraivs".

1.png

 

and Error happened. 1.png

 

 

 

 

 

 

and by dump the attachement from Microsoft Teams - Alert the team.
"Attachments" propertys is 
  "Has Attachment" = True,
  "Name" = 1.png,
  "Content-Type" = image/png.

What can I do for figure out this issue ?

Regard,
Yoshihiro Kawabata

Power Automate Staff TravisB
Power Automate Staff

Re: Error at Mail attachment file to create a file in File System.

Hi @yoshihirok,

 

In addition to "Has Attachment" you're also going to want to check "Include attachment."

 

"Has attachment" makes it so that the flow only triggers on emails that have attachments. This is good to have for your use case since you're only interested in emails with attachments and you don't want to trigger a bunch of flows for things you don't care about.

 

"Include attachment" is what actually includes the attachment content. Without that you just get some metadata about the attachments, not the actual content.

 

Hope this helps!

 

Best,

Travis

View solution in original post

yoshihirok
Level 10

Re: Error at Mail attachment file to create a file in File System.

Thank you, Great Thank you @TravisB, I can create a file from mail attachment.

"Has Attachment" = Yes, and "Include Attachment" = Yes.

 

1.png

 

 

 

I share this Tips at this community.
"Tips: Save mail attachment file to File System "
https://powerusers.microsoft.com/t5/General-Flow-Discussion/Tips-Save-mail-attachment-file-to-File-S...

 

Now I can do more with Mail attachment and Microsoft Flow.

 

Regards,

Yoshihiro Kawabata

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Users Online
Currently online: 159 members 5,693 guests
Please welcome our newest community members: