Today, we will demonstrate how to save email attachments from different sources into specific SharePoint folders. Here’s the flow chart for creating a flow from scratch.

Create a New Flow
- On the Power Automate home page, click the Create button at the top-left corner.
- Choose Automated cloud flow.

Select a Trigger
- Name the flow and search for the trigger.
- Select the trigger When a new email arrivers (V3), as we’re using Office 365 Outlook, and click the Create button.

Configure the Trigger
- Click the trigger, the Parameters panel will appear.
- Click Show all to display all parameters or select the necessary ones from the drop-down arrow.
- Set Include Attachments and Only with Attachments to Yes so that the flow triggers only when an email with attachments arrives.

Add Actions
- Click the Add an action icon under the trigger, the Add an action panel appears.
- Search for Condition action and choose it.

Configure Actions
- On the Condition Parameters panel, click the Lightning icon to insert dynamic content from previous steps.
- Choose From value to configure the sender condition.
- Select the Contains operation and enter “kids”, which is part of the internal email address domain, indicating the sender is from inside the organization.

There’re two branches under the condition, meaning different criteria will result in different actions. If the condition is true, save the email attachments to the Internal Email Attachments folder in SharePoint. Otherwise, save the email attachments to the External Email Attachments folder.
Before proceeding, create the folders in the SharePoint document library.

If the condition istrue, insert a new action Create file under the SharePoint connector.

- Configure the Parameters for the Create file action:
- Select the Site Address and Folder Path. If there are no options for site address selection, click Enter Custom Value and manually enter the site address of your SharePoint home page.
- Use the Attachments Name as the File Name. You can also add the email’s Received Time for easier future retrieval. You can click See more on the dynamic content panel to view all values from the previous step or search for them directly.
- Set the File Content to the Attachments Content.
- Insert another Create file action if the condition is false, but set the Folder Path differently.


Save the Flow
Click the Save button at the top right corner to save the flow.
Test the Flow
- Click the Test button at the top right corner, choose Manually,and click Test to test the flow manually.
- Send an email with attachments to your mailbox from an internal email address and an external email address separately.
- Verify that the attachments have been saved in the specific SharePoint folders.

