Others

How to Send a Selected Power Apps Gallery File by Email

Bushra ParveenBushra Parveen Oct 23, 2026 868 views

Question details

The user wants to know how to set up a Power Apps gallery that allows users to select a specific template file and send it as an email attachment.

How to Send a Selected Power Apps Gallery File by Email
Product
Power Apps
Device & OS
not provided
Scenario
Building an application in Power Apps where users interact with a gallery of files and need a button to email the selected file to themselves or others.
Observed behavior
Requires a method to capture the selected file's identifier from the gallery, retrieve its content from the storage library, and execute an email sending process.
Before you start

Ensure you have active licenses for Microsoft Power Apps and Power Automate, and that your template files are stored in a cloud-accessible location such as SharePoint or OneDrive.

Solution 1Recommended

Connect Power Apps to a Power Automate Flow

Create a Power Automate flow triggered by Power Apps to securely retrieve the file content and send it via the Office 365 Outlook connector.

While Power Apps has an Office 365 Outlook connector, handling complex binary file content directly from a gallery can be challenging. Passing the file identifier to Power Automate and letting the flow handle the attachment retrieval is the most robust and recommended solution.

1
Create a new Flow

Navigate to Power Automate, create a new 'Instant cloud flow', and select 'PowerApps' as the trigger.

2
Retrieve the file content

Add the 'Get file content' action (e.g., for SharePoint or OneDrive). Click inside the File Identifier field and select 'Ask in PowerApps' from the dynamic content menu to create a variable.

3
Add the email action

Add the 'Send an email (V2)' action from the Office 365 Outlook connector. Fill out the To, Subject, and Body fields. You can also use 'Ask in PowerApps' for the recipient's email address if it needs to be dynamic.

4
Configure the attachment

In the 'Send an email (V2)' action, expand the advanced options. In the 'Attachments Name' field, enter the file name with its extension. In the 'Attachments Content' field, select the output from the 'Get file content' action.

5
Link the flow to your gallery

Go back to your Power Apps canvas. Select the email button inside your gallery. In the top ribbon, click 'Action' > 'Power Automate' and add your new flow. Update the button's OnSelect property to run the flow, passing the selected item's ID and recipient email as parameters (e.g., `YourFlowName.Run(ThisItem.ID, User().Email)`).

Connect Power Apps to a Power Automate Flow
Test your flow: Always use the 'Test' feature in Power Automate while clicking the button in your Power Apps preview mode to ensure the file identifier is being passed correctly.
Free Microsoft Office alternative

Switch to WPS Office for Seamless Template Management

Before automating document workflows in Power Apps, you need a reliable way to create and edit your templates. WPS Office provides a free, lightweight suite to manage your Word, Excel, and PowerPoint files flawlessly before integrating them into your cloud workflows.

  1. 1. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
  2. 2. Create your templates: Open WPS Writer or Spreadsheet to design the documents you intend to feature in your Power Apps gallery.
  3. 3. Save in standard formats: Save your documents as DOCX or XLSX files and upload them to your SharePoint or OneDrive to be used in your automated email flows.
Fully compatible with Microsoft Office formats (DOCX, XLSX, PPTX) ensuring zero formatting issues in your Power Automate flows.Lightweight architecture for fast loading, editing, and saving of your business templates.Built-in premium PDF tools allow you to easily create secure, uneditable templates for your gallery.Familiar user interface requires no learning curve, keeping your team productive.
microsoft office alternative - wps office

Frequently Asked Questions

Can I send an email directly from Power Apps without using Power Automate?

Yes, you can use the Office365Outlook.SendEmailV2 function directly within Power Apps. However, attaching files straight from a gallery via this method is often limited to specific data types (like camera captures or pen inputs) and requires complex Base64 encoding. Power Automate is the standard method for retrieving physical files from cloud storage.

Why is my email attachment empty or corrupted when sent via the flow?

This typically occurs if the 'Get file content' action in Power Automate fails to fetch the actual binary data, or if the 'Attachments Content' field in the email action is mapped to the file name instead of the file content. Double-check your dynamic content mappings in the flow.

How do I email multiple selected files from a Power Apps gallery at once?

To send multiple files, you must add the selected gallery items into a collection in Power Apps. Then, format the collection as a JSON array and pass that JSON string to Power Automate. Inside the flow, use the 'Parse JSON' action and loop through the array to retrieve each file's content and append it to an array variable before sending the email.