
I have a Sharepoint subfolder with Excel spreadsheets.
I would like to create a Power Automate Flow that extracts the most recently modified Excel spreadsheet from this subfolder, then attach that spreadsheet to an Outlook (V2) connector.
I have already created a simple flow that extracts a file within a Sharepoint subfolder, then attaches that file to an email:
This is my Get File Content Using Path, showing it extracting a specific file:
This is my Outlook Send an Email (V2) step where that file is attached:
I am sharing this to show that I know how to attach a file to an email, and to show that I know how to find the file path for a Sharepoint file. This flow is part of my current work-around, which is to have a subfolder where I overwrite a file with the same username and upload the only file within that subfolder.
However, I would like help with a) extracting the most recently modified file from a subfolder with many files and b) attaching that file to an Outlook email. Here is my attempt at extracting the most recent file from a SHarepoint folder and attaching it to an Outlook email:
This is my List folder action:
This successfully returns information on both of the files in this subfolder:
Compose action
My compose action has this powerfx code in the Inputs:
This is my outlook (send an email (V2)) action:
This is th e code view of the Outlook action:
How would you recommend I change my flow so I can successfully attach the most recently uploaded file? I have used the Outlook Send an Email (V2) attachment many times to email files to myself but I seem to be struggling with extracting the most recent file from a subfolder and attaching that file to an Outlook email.
I would prefer to not use Premium connectors.