cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
yoshihirok
Memorable Member
Memorable Member

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
TravisB
Power Automate
Power Automate

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
ShubhamGogna
Microsoft
Microsoft

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

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

TravisB
Power Automate
Power Automate

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

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
User Groups Public Preview

Join us for our User Group Public Preview!

Power Automate User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Users online (62,151)