Add the “Add picture control” to a screen and set the AddMediaButton component to add the photo and a random filename to a collection.
“OnSelect” of AddMediaButton1 button add a collection as follows: ClearCollect(colPics, {Pic:UploadedImage1.Image,Name:Rand() &”.png”})
2. Add a button to the screen and create a flow from it using the Action menu.
Click on “Flows” from “Action” Menu to create a new flow.
3. In the freshly minted flow, add a Parse JSON action, and in the content textbox, choose Ask in PowerApps from the data panel and add the following schema…
Img: In MS Flows add “Parse JSON” action and for “Content” just click on the Content textbox and from Right side, In PowerApps section select “Ask in PowerApps”. For Schema, just paste the above json content.
4. Add a Create File action from SharePoint or OneDrive. In this case I will use SharePoint. From the data panel, set the File Name to Name from the Parse JSON action output. Since this is an array of files, Flow will wrap this action inside an Apply to Each action.
5. For the file content action, add an expression as follows:
decodeDataUri(item()['Pic'])
This expression is basically saying “for the selected array of photos, grab the Pic content and turn it back into binary
6. Save the flow and go back to your PowerApps. Choose the button “Save Pic to SP” again and link to your newly created Flow via the action menu.
Img: Select the flow which we created
7. Complete the expression on the button as follows…
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
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.
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
To get Current logged-in user's Manager email:Office365Users.Manager(User().Email).Mail);
To get Current logged-in user's Manager's Manager email: Office365Users.Manager(Office365Users.Manager(Office365Users.MyProfile().Mail).Mail).MailTo display logged in user image: Office365Users.UserPhoto(User( ).Email)Note: To display user image in rounded shape, adjust the "Border Radius" value for smaller images use "Border Radius" as : 70.