cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
beniwal
Helper III
Helper III

problem saving Word Document to sharePoint

Hi,

 

I have created a flow to store email attachments to Sharepoint. It is working absolutely fine for all file types except Word Document.

 

It saves the file in SharePoint but I am not able to open it. 

Error: Unreadable Text

 

And I am using this formula on click of a download icon in a gallery(Item:  attachments of an incoming email) :

 

UploadafiletoSharePointfromPowerApps_1.Run(ThisItem.Name,ThisItem.ContentBytes)

image.png

Please Guide, Thanks in advance

Mohit

1 ACCEPTED SOLUTION

Accepted Solutions
RezaDorrani
Dual Super User II
Dual Super User II

Hi @beniwal 

 

Check this video

https://www.youtube.com/watch?v=5XsWgVnR7SU&t=601s

 

Try using the new JSON Include binary data feature in Flow to send data to Flow from PowerApps

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

5 REPLIES 5
RezaDorrani
Dual Super User II
Dual Super User II

Hi @beniwal 

 

Check this video

https://www.youtube.com/watch?v=5XsWgVnR7SU&t=601s

 

Try using the new JSON Include binary data feature in Flow to send data to Flow from PowerApps

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

hi @RezaDorrani 

 

Thank it worked!

 

I have a few more questions.

1. how can we know the flow we triggered is successful? it just returns a boolean value if it is triggered.

    I am using the below formula 

    UpdateContext({attachmentSave: saveAllAttachments.Run(JSON(emailAttach,JSONFormat.IncludeBinaryData))});
    If(attachmentSave,Notify("Saved success",NotificationType.Success),Notify("Error while           saving",NotificationType.Error));

 

A success message appears after a few seconds but my flow is taking more than 1 minute(Maybe because I am saving 6 files at once)

 

Also, I have observed even if the flow has some error and it fails the flow function returns true.

 

2. How I can get the link of the file that I just saved in SharePoint so that I can use Launch function?

 

Thanks,

Mohit

 

RezaDorrani
Dual Super User II
Dual Super User II

Hi @beniwal 

 

1- In flow you can send response back to PowerApps. Normally response type string is the most stable

so you can actually send a string back like true or false

 

PowerApps calling Flow and flow respondign back (has a 2 min timeline else it will timeout)

 

if there is an error in Flow, you can use "configure run after" to handle errors

 

2- When you create item in sharepoint using Flow, you will get the ID, file path etc. of the item from dynamic content

You can pass that value also back to PowerApp from Flow ( make this also a string value to return)

 

then in PowerApps use the launch function and to open it 🙂

 

 

 

 

Hi @RezaDorrani ,

 

Thanks a lot for your help! 

 

Can you please suggest any youtube video for error handling and getting data back from flow?

 

Thanks,

Mohit

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (21,489)