cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Issue saving email attachment to Onedrive

I have a fairly basic workflow built from the "Save Office 365 email attachments to OneDrive for Business" template, modified to check for attachment name contains .csv 

The flow executes successfully and the csv file produced has the correct filename but only contains a single value of "null"  instead of the contents from the attachment

I've created similar flows in the past with no issue, and I tried recreating everything from scratch multiple times. Also tried triggering from a shared mailbox instead. All return the same value.  Anyone know why this is happening and how I can create a file with the correct content?

 

Thanks in advance 

1 ACCEPTED SOLUTION

Accepted Solutions
tom_riha
Super User
Super User

Hello @Anonymous ,

try to convert the 'Attachments content' into binary encoding using the base64ToBinary(...) expression when creating the file, Power Automate has often problems with processing email attachments.

When building the expression with base64ToBinary(...) the 'Attachments content' dynamic content will probably be missing, but you can solve that by storing the 'Attachments content' in a 'Compose' action and then use the output from the 'Compose' in the expression.

image.png

 



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

7 REPLIES 7
Expiscornovus
Dual Super User
Dual Super User

Hi @Anonymous,

 

Just to validate. I assume the create file action is configured like this? It's using name and contentBytes fields from the Attachments array of the trigger action output?

 

triggerOutputs()?['body/attachments']

 

createfileattachments.png

 

Can you also share a screenshot of the output of your create file action?

Anonymous
Not applicable

Hello there @Expiscornovus!

 

You are correct. My create file action is configured exactly as pictured. I have attached some screenshots of the file before and after processing, along with some test results that show the new 4byte filesize 

 

Before:

Capture2.PNG

 

Capture4.PNG

After: 

Capture3.PNG

Expiscornovus
Dual Super User
Dual Super User

Hi @Anonymous,

 

Another question. Can you check the configuration of your trigger action.

 

Is the Include attachments by any chance set to No instead of Yes? If so, can you change that to Yes?

includeattachments_yes.png

Anonymous
Not applicable

Hey @Expiscornovus 

 

I checked and it was set to No. Changed to Yes but same result

Expiscornovus
Dual Super User
Dual Super User

Hi @Anonymous,

 

Can you show the output of the trigger action of your last test?

tom_riha
Super User
Super User

Hello @Anonymous ,

try to convert the 'Attachments content' into binary encoding using the base64ToBinary(...) expression when creating the file, Power Automate has often problems with processing email attachments.

When building the expression with base64ToBinary(...) the 'Attachments content' dynamic content will probably be missing, but you can solve that by storing the 'Attachments content' in a 'Compose' action and then use the output from the 'Compose' in the expression.

image.png

 



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]
Anonymous
Not applicable

 Thank you both for the assistance! I'm marking @tom_riha post as my solution. I'm not sure why the original configuration stopped working, but using the base64toBinary expression has restored functionality to my flow. Thank you much!

Helpful resources

Announcements
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.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (1,171)