Power Automate save email attachment to SharePoint

    Do you want to save email attachments to SharePoint using Power Automate Automate? This Power Automate tutorial will show us how to save email attachments to SharePoint in Power Automate.

    Also, we will cover how to save email attachments to SharePoint with a different name using Power Automate. Finally, we will save only PDF attachments to SharePoint using Power Automate.

    Power Automate save email attachment to SharePoint

    Here we will see how to save email attachments to the SharePoint document library using Power Automate.

    For example, we receive ‘Resume attachments’ in the company Outlook email address every day, and I want to automatically save those attachments to the Resume document library in SharePoint.

    power automate save email attachment to sharepoint

    To do this in Power Automate I have followed the below steps:

    1. Open Power Automate Cloud, create an Automated Cloud flow, and then select a trigger action as ‘When a new email arrives (V3)’ action. Then provide the below information:

    • Folder: Select Inbox from the option
    • Include Attachments: Select the Yes option
    • Only with Attachments: Select the Yes option.
    power automate save email attachment to sharepoint

    2. Now we will get email attachments, for this, click on the +New step -> select Get attachments(V2) action. Then provide the below information:

    • Message Id: Select Message ID from dynamic content. This will automatically apply to each action.
    • Attachment id: Select Attachment attachment id from dynamic content.
    power automate save attachment to sharepoint

    3. Finally, we will save email attachments in the SharePoint document library, for this click on the +New step -> select Create file action. Then provide the below information:

    • Site address: Provide the SharePoint site address.
    • Folder path: Select the Folder path from dynamic content.
    • File name: Select the file name from dynamic content.
    • File content: Select the content bytes from dynamic content.
    save email attachment to sharepoint power automate

    4. Now save the flow and run the flow manually, then send an email to the Outlook inbox.

    power automate get attachment from email and save to sharepoint

    You can see the above email attachments are saved in the SharePoint document library

    save my email attachments to a sharepoint document library

    This is how to get attachments from email and save to the SharePoint document library using Power Automate.

    Power Automate save email attachments to SharePoint with a different name

    Here we will see how to save email attachments to SharePoint with a different name using Power Automate.

    For example, whenever a client sends project-related documents via email, I want to automatically save these attachments to the SharePoint document library named “Project Documents” with a new name that includes the original attachment name and today’s date.

    save email attachments to sharepoint power automate

    To save email attachments to SharePoint with a different name follow the below steps using Power Automate.

    1. Open Power Automate Cloud, create an Automated Cloud flow and then select a trigger action as ‘When a new email arrives (V3)’ action. Then provide the below information:

    • Folder: Select Inbox from the option
    • Include Attachments: Select the Yes option.
    • Only with Attachments: Select the Yes option.
    power automate save email attachment to sharepoint

    2. Next, initialize two variables for the Attachment name and today’s date. for this click on the +New step -> select Initialize variable. Then provide the below information:

    NameTypevalue
    Attachment nameString
    Todays dateStringformatDateTime(utcNow(),’yyyy-MM-dd’)
    power automate email attachment to sharepoint

    3. To get the attachment from an email, click on the +New step -> select Get attachment(V2) action. Then provide the below information:

    • Message-Id: Select Message ID from dynamic content. This will automatically apply to each action which will loop through messages.
    • Attachment id: Select Attachment attachment id from dynamic content. this will add another Apply to each action that will loop through attachments.
    power automate save email attachment

    4. To get the attachment or file name, for this, click on the +New step -> select Compose action. Provide the below information:

    • Inputs: Provide the below expression:
    first(split(outputs('Get_Attachment_(V2)')?['body/name'], '.'))
    save attachment from email to sharepoint power automate

    5. To get the attachment extension, click on the +New step -> select Compose action -> provide the below information:

    • Inputs: Provide the below expression:
    last(split(outputs('Get_Attachment_(V2)')?['body/name'], '.'))
    How to save attachment from email to sharepoint power automate

    6. Next, we will combine filename, today’s date, and extension to create a new file name, for this click on the +New step -> select Set variable action. Then provide the below information:

    • Name: Select the Attachment name from the dropdown.
    • Value: Provide the below expression:
    concat(outputs('Compose'), '-', variables('Date'), '.', outputs('Compose_1'))
    power automate get email attachment to sharepoint

    7. To save email attachments to SharePoint with different names, click on the +New step -> select Create file action, and then provide the below information:

    • Site address: Provide the SharePoint site address
    • Folder path: Provide the folder path
    • File name: Select the Attachment name variable from dynamic content.
    • File content: Select content bytes from dynamic content.
    power automate save email attachment to sharepoint with different name

    8. Now save the flow and run the flow manually. Then send an email to the Outlook inbox.

    send email attachment to sharepoint folder

    You can flow runs successfully and the email attachment is saved to SharePoint with a different name.

    send email attachment to sharepoint folder using Power Automate

    This is how to save email attachments to SharePoint with different names using Power Automate.

    Power Automate saves only PDF attachments

    Here we will see how to save only PDF attachments to the SharePoint document library using Power Automate.

    when an employee submits an expense reimbursement document via email, requesting reimbursement, the attachments will be automatically saved in the Expense Reimbursement Document Library in SharePoint.Additionally, a condition is applied to ensure that the document is in PDF format.

    save my email attachments to a sharepoint document library

    To do this using Power Automate follow the below steps:

    1. Open Power Automate Cloud, create an Automated Cloud flow, and then select a trigger action as ‘When a new email arrives (V3)’ action. Then provide the below information:

    • Folder: Select Inbox from the option
    • Include Attachments: Select the Yes option.
    • Only with Attachments: Select the Yes option.
    power automate save email attachment to sharepoint

    2. Next, we will check the attachment type, for this click on the +New step -> select Condition action. Provide the below information:

    • Choose a value: Select the Attachment name from dynamic content. This will Apply to each action to the flow.
    • Operator: Select the operator as ‘contains’ from the option
    • Choose a value: Write the value as .pdf
    power automate copy attachment to sharepoint

    3. If the condition is true, then we will get an attachment from the email, for this, click on the +New step -> select Get attachment (v2) action.

    Provide the below information

    • Message Id: Select Message ID from dynamic content.
    • Attachment id: Select Attachment attachment id from dynamic content. This will add another Apply to each action that will loop through attachments.
    power automate save only pdf attachments

    4. To save only PDF attachments in the SharePoint document library, for this, click on the +New steps -> select Create file action. Provide the below information:

    • Site address: Provide the SharePoint site address
    • Folder path: Provide the folder path
    • File name: Select the Attachment name variable from dynamic content.
    • File content: Select content bytes from dynamic content.
    power automate attachment to sharepoint

    5. Now save the flow and run the flow manually. Then send an email to the Outlook inbox to trigger the flow.

    power automate save attachment from email to sharepoint

    You can flow runs successfully and the email attachment is saved to SharePoint with a different name.

    power automate save email attachment to sharepoint

    This is how to save only PDF attachments to the SharePoint library using Power Automate.

    Conclusion

    In this Power Automate tutorial, I have explained how to save email attachments to SharePoint using Power Automate. This tutorial will help you to get attachments from email and save to the sharepoint document library using Power Automate. Also, it covers:

    • Power Automate save email attachments to SharePoint with a different name
    • Save email attachment to SharePoint in Power Automate.
    • Power Automate save only PDF attachments

    You may also like:

    comment_count comments
    Oldest
    Newest
    Oldest

    Comment as a guest:

    >