Table of contents
- Control options
- Upload options
- Attaching files to items
- Single file upload using Power Automate
- Multi-file upload using Power Automate
- Changelog
Control options
In Power Apps there are different options to load pictures into the app and process them from there. Here are the controls available:
Attachment control (Form) | Add Picture Control | Camera | |
Official links | https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/controls/control-attachments | https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/controls/control-add-picture | https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/controls/control-camera |
Desktop behavior | File picker opens without file type filter | File picker opens with filter in images | Shows instant camera live stream of selected camera or webcam. |
Mobile behavior | User will be asked to choose camera, photo library or select files.
Camera mode includes device native camera features. | User will be asked to choose camera, photo library or select files.
Camera mode includes device native camera features. | Shows instant camera live stream of selected camera.
No device native camera features like zoom or switch. Won’t store photo metadata.
Switching between front and back camera needs to be build into the app itself (not difficult). |
Quality of images | Full quality | Picture might be pixelated when “Optimize images for upload” is checked. Usually by default on.
https://learn.microsoft.com/en-us/power-apps/mobile/optimize-images-upload | Full quality |
Best used when | Working with desktop and/or mobile users. Single and multiple file upload. | Working with desktop and/or mobile users.
Single file upload and with more effort multiple files. | Working with desktop and/or mobile users.
Only if users are to take pictures and nothing else.
e.g. Front desk applications, where users need to check by taking a picture of them or Inspection applications
Will not recognize QR Codes. Use the Barcode Reader control instead. |
This is what the attachment and add picture control shows on iOS when clicking to add files or pictures. I would believe it is the same for Android, but I cannot confirm that 100%.
Upload options
Attaching files to items
You can use the attachment control with a form by default or parts of the form with Patch() to upload files while creating or updating an item in a SPO list. In this case I will explain using the Patch() formula.
The good: Most simple method, does not require Power Automate
The bad: Will only save as attachments to an item. Best practice would be to not use attachments that much.
- Add a form control. Connect to the list that you want to store the items and attachments to. Then only make the attachment field visible and remove all others.
- Add your other required inputs as control to your screen and add a button.
- The OnSelect will now include a basic patch statement as well as the form data. Like this:
- When you click the button now the item data as well as the form data (attachments) is patched to the list.
Patch(
ListA,
Defaults(ListA),
{
Title: TextInputCanvas2.Value
},
Form5.Updates
)Single file upload using Power Automate
The good: Works for files in libraries and for attachments
The bad: Requires a Power Automate flow
- Add only the attachment control from a form control. Add a form, connect it to any list or library and cut out the attachment control. No the whole data card, only the control for the attachments. In my example it looks like this. Remove the rest of the form control and adjust the errors in the attachment control. Set “Max Attachments” to 1. Adjust other values as needed.
- Navigate to Power Automate and create a new instant flow.
- Trigger: When Power Apps calls a flow (V2)
- Add the file input to it
- If necessary, add more inputs
- Add one action: Create file
- Configure your site and library, then add file content name and file content bytes from the dynamic values
- Add another action: Respond to a Power App or flow
- If you want to return information to the power apps, add outputs here
- This is what the whole flow looks like in its most basic version
- Navigate back to Power Apps and add your flow to the app.
- Open the OnSelect property of the save button and add the formula to run your flow. The file input in Power Automate expects a record value like this:
- All in all, the formula would look like this. This will only upload the first (and only) file from the attachment control.
- If you need to link files from that library to items in another list, you can add more inputs to your flow and store the item id with the file as metadata.
{
name: "Filename with extension",
contentBytes: "base64 of file, altough in app this a value from blob storage"
}UploadsinglefiletoSPO.Run(
{
name: First(AttachmentControl.Attachments).Name,
contentBytes: First(AttachmentControl.Attachments).Name
}
)Multi-file upload using Power Automate
You can technically use the single file upload version above here again, with a simple code adjustment in Power Apps. If you have multiple files in your attachment control, just use ForAll() to have a flow run for each file.
The good: Works for files in libraries and for attachments
The bad: Requires a Power Automate flow, triggers a flow run for each file
ForAll(
AttachmentControl.Attachments As File,
UploadsinglefiletoSPO.Run(
{
name: File.Name,
contentBytes: File.Value
}
)
)BUT, we would always want to optimize performance and if the flow can be triggered only once not matter the amount of files, perfect. One downside, it only works with the add picture control. I will only describe the workflow and formulas briefly in a text. Advanced users will know what to do.
The good: Works for files in libraries and for attachments, can create multiple files with one flow run
The bad: Only works with add picture control, requires a Power Automate flow, the flow has more actions and therefore runs longer
- Using the add picture control add images and files to a collection in your app
- Create a flow with text as input. We will pass the collection as a JSON from the app to the flow by using the JSON(collection,JSONFormat.IncludeBinaryData) statement.
- In your flow parse the text input into real JSON data using the JSON() expression.
- As the content bytes include the URI headers (like this: data:image/png;base64,iVBORw0KGgo…) you will need to remove the headers with substring. The create file action will only need everything after “base64,”.
- After you have removed the headers, use the create file action to create the file. For the file content use your substringed text and convert to binary using base64ToBinary() expression.
- Configure a button in your power app to start the flow once and pass the collection into it. Add more inputs if necessary.
Changelog
Date | Changes |
02.01.2026 | Initial version |
❤️ Thanks for reading.