Extract attachments from incoming emails (Outlook and Gmail), OneDrive or GoogleDrive.
First, put in place a trigger or action to retrieve the email information.
- When a new email arrives Trigger(Office 365 Outlook)
- Get emails Action(Office 365 Outlook)
- When a new email arrives Trigger(Gmail)
You can set the condition for retrieving the email in the trigger or action you put in place, though, At this time, set "Include Attachments" to "Yes".
If there are no attachments, it is more efficient to set "Yes" to "Has Attachments".
Put in place "Create File(OneDrive For Business)" or "Create File(Google Drive)" in the subsequent steps.
Then, specify the "Attachment Name" of the dynamic content in the "File Name" field.
When specified, "Apply to each" is automatically added, which is normal.
The "Select an output from previous steps" is specified as "Attachments".
Apply to each" is a looping process that repeats the action inside for the number of attachments.
In the state below, "Create File(Google Drive)" will be executed as many times as there are attachments in the mail.
Next, specify "Attachment Contents" in the "File Content" field.
This completes the When the flow is executed, the attachment will be saved in the designated folder.