Upload Image from PowerApps to Flow to SharePoint via an Unused Outlook connector
This is the simplest no code approach to the PowerApps image upload problem so far. Far simpler than with Azure Function, with custom connector, with hacked Flow button via Flow Studio, even simpler than Azure Blob Storage. All standard connectors so no premium required, and no risk of PowerApps trigger resetting and breaking the connection.
This is my simplest method to upload any image from PowerApps to SharePoint
No Swagger
No Edit JSON
No Azure Blob Storage
All Standard Connectors
No HTTP
Can easily add more arguments
Original
This blog post is a cleaned up version of the #Flow Ninja hack 87 thread which happened on Sunday night. https://twitter.com/johnnliu/status/1114863521525669888
Follow me on Twitter and catch the next live hack.
[Updated: 2019-04-27] Video version, PnP SharePoint Community Call from Chaks
From @chakkradeep
Steps - first a bit of study and exploration
I have a @MicrosoftFlow hack this evening to send files from @PowerApps to @SharePoint I have been thinking about this one for a while. So if you are still awake, follow along.
First - I check the Flow button trigger.
Then create a PowerApps trigger, use peek code to study
Double check SharePoint connector - I read this with FlowStudioApp - there's no method that takes format: byte. Everything wants format: binary.
I spent a while looking through various standard connectors looking for something that does format: byte - I found one. In the Outlook connector.
In send email with attachment. **cackle** **evil grin**
Evil twinkle in the eye acquired - we now execute the plan
So we hack the PowerApps trigger. by using a totally unrelated connector.
I can't hold back my dislike of the PowerApps trigger. Why can't it behave more like the Flow button trigger...
The argument sendanemail_attachmentscontent is ugly. Try using Flow Studio to rename them first before you go too far. This will also make the connection tidier when you take it over to PowerApps.
Finally
PowerApps time - this is probably my simplest method.
Don't need Azure blob storage
Don't need edit json
Don't need swagger
Can have multiple arguments
Just need to conditionally build a strange Flow that doesn't use the outlook connector but use it to lock the PowerApps trigger
See the condition is always false - it doesn’t run
See also the Size of the create file is much larger than a broken blob string
We need to keep the unused Send an email action even if we don’t use it - because it locks the PowerApps trigger in place so the trigger doesn’t reset.
And there we have it - the absolutely simplest no-code solution to send a File from PowerApps to SharePoint with ease.
We lock the PowerApps trigger to format: byte by using an otherwise unused Outlook send mail connector.
Future
There are a few things Microsoft could do that will make this even easier. If they ever get around to it:
Allow us to define PowerApps trigger directly either by using Flow Button UI or Request schema
Allow SharePoint connector to accept format: byte
Allow PowerApps to send format: binary, right now PowerApps converts that to string, dropping the non-character bytes from the data it sends to Flow