cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
momureithi
Helper II
Helper II

Power Automate · Attachment Not Opening

Hello,

 

I'm experiencing a problem where the attachment sent out with the approval notification is not opening. On the flow, I have used the "Get attachments" from SharePoint connector.

 

When the approval request notification is sent out to the approver on email, they are able to open the attachment.

momureithi_0-1597053743975.png

What could be the problem?

 

Thanks.

 

1 ACCEPTED SOLUTION

Accepted Solutions

Howdy,

 

I think the problem is with with Append Array.

 

It should be in format:

 

{
"Name": @{items('Apply_to_each')?['DisplayName']},
"ContentBytes": @{body('Get_file_content')?['body']}
}

 

CFernandes_0-1597141613519.png

 

Complete solution:

CFernandes_1-1597141684522.png

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

 

View solution in original post

10 REPLIES 10
manuelstgomes
Super User
Super User

Hi @momureithi 

 

Please check that you're sending the attachment contents when sending the email. If you're doing this can you please share the section of the Power Automate that is failing and the error so that I try to help you?

 

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

Cheers
Manuel

CFernandes
Super User
Super User

Howdy @momureithi 

 

"Get attachments" will not return the file content, you need to use the SharePoint 'Get File Content" to get the File content, and then pass "File Content" to Send an email action from a high level your Flow should look like below.

 

CFernandes_1-1597060167546.png

 

I hope this helps.

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

Howdy @CFernandes,

This is my current set up. Does it look good or should I switch it up to match your illustration?

Please let me know.

 

momureithi_0-1597132158198.png

Howdy @momureithi 

 

The problem with your Power Automate solution is that you are creating the File array incorrectly.

 

The Correct format should be 

 

{
"Name": @{items('Apply_to_each')?['DisplayName']},
"ContentBytes": @{body('Get_file_content')?['body']}
}

 

CFernandes_0-1597134110035.png

 

Complete solution:

untitled-1

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

 

Howdy,

 

I think the problem is with with Append Array.

 

It should be in format:

 

{
"Name": @{items('Apply_to_each')?['DisplayName']},
"ContentBytes": @{body('Get_file_content')?['body']}
}

 

CFernandes_0-1597141613519.png

 

Complete solution:

CFernandes_1-1597141684522.png

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

 

View solution in original post

Many thanks, @CFernandes! Worked like a charm. 👍

I, however, encountered the error below during the flow run (are you able to establish why?) :

 

momureithi_0-1597147386990.png

Fixed it by encoding the file content to base64 (not sure if it's a recommended approach?) :

 

{
"Name": @{items('Apply_to_each')?['DisplayName']},
"Content": @{base64(body('Get_file_content'))}
}

 

momureithi_1-1597147489773.png

Complete solution:

momureithi_0-1597149258268.png

 

Err.. I assume you stumbled over a known bug. I have stumbled on this before.

 

 Approvals action does not recognize contentbytes and so you need to use the content key to pass the file content. 

 

Untitled.png

Well understood - thank you.

Perfect. If my replied has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,182)