A community-built Power Platform sample

Archive email and attachments in pdf

Flow that archives an email and its attachments in a single pdf file

Power Automate
Flow overview
Last updated
Jan 24, 2026
Category
Cloud flows
Premium license
Not required
Experimental features
No

From idea to implementation

Make it your own.

Check this sample's prerequisites, permissions, and licensing before importing it. The documentation below comes directly from the sample README.

Summary

This sample showcases how to merge an email and its attachments into a single PDF file using standard Power Automate actions. The generated archive PDF is stored in a designated OneDrive folder. Additionally, the flow highlights how to leverage the conversion capabilities of the OneDrive connector to handle Office documents and PDF files as part of the archival process.

Features:

  • Archive email and attachments (office docs, pdf etc.) into a pdf file
  • Export email as html file
  • Method to combine email and attachments
  • Expression

Flow overview

Applies to

Power Automate

Compatibility

Premium License On-Premises Connectors Custom Connectors

Contributors

Version history

Version Date Comments
1.0 Jan 24, 2026 Initial release

Prerequisites

Connection References

The solution includes two connection references.

  • Office 365 Outlook Connection
  • OneDrive For Business Connection

Environment Variable

When importing the solution, there are a variety of environment variables that need to be completed.

Variable Type Details
Incoming Email Subject Text Defines the subject filter used to trigger the workflow from an email
Output Archive Folder Text Specifies the OneDrive folder path where the archived PDF will be saved

Minimal Path to Awesome

Import Solution

  • Download the .zip from the solution folder
  • Import the .zip file using Solutions > Import Solution.

Using the source code

You can also use the Power Apps CLI to pack the source code by following these steps:

  • Clone the repository to a local drive

  • Pack the source files back into a solution .zip file:

    pac solution pack --zipfile pathtodestinationfile --folder pathtosourcefolder --processCanvasApps
    

    Making sure to replace pathtosourcefolder to point to the path to this sample's sourcecode folder, and pathtodestinationfile to point to the path of this solution's .zip file (located under the solution folder)

  • Within Power Apps Studio, import the solution .zip file using Solutions > Import Solution and select the .zip file you just packed.

Features

This sample illustrates the following concepts:

  • Reusablility
  • Use of XML & XPATH for complex automation scenerios
  • Use of complex nested expressions
  • Concept of parent-child flow

Help

We do not support samples, but this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues.

If you encounter any issues while using this sample, you can create a new issue.

For questions regarding this sample, create a new question.

Finally, if you have an idea for improvement, make a suggestion.

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.