web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Most recent file in on...
Power Automate
Unanswered

Most recent file in one drive or email

(0) ShareShare
ReportReport
Posted on by

Im looking for a way to take the most recent  excel file in one drive and convert the worksheet to tables. Im having a hard time finding a way to choose the most recent file as the selections I see want to point to a specific file. 

Categories:
I have the same question (0)
  • v-yamao-msft Profile Picture
    on at

    Hi @jchauvet,

     

    Do you want to get the most recent file in OneDrive and then convert it to a table?

    I have figured out a way to get the most recent file in OneDrive, please check the following flow for a reference.

    Add a button trigger.

    Add OneDrive connector List files in folder.

    Initialize variable, set Name as Max, Type as Array.

    Add Apply to each, inside the Apply to each add the action Append to array variable. Set Name as Max, and set Value with the following code:

    ticks(items('Apply_to_each')?['LastModified'])

    Under the Apply to each, add a Compose action with the following code to get the Max value:

    max(variables('Max'))

    Add Apply to each 2, select output Value from the action List files in folder.

    Within the Apply to each, add a Condition with the following code to get the Max one:

    @equals(ticks(items('Apply_to_each_2')?['LastModified']), outputs('Compose'))

    Under if yes branch, add a Compose to return the file name.

    Screenshot for your reference.

    1.PNG

    To convert the worksheet to Excel table, we will have to use the Excel Online action Create table. However, dynamic content in File&Table inputs are not supported in Excel Online connector. So I am afraid that we could not achieve creating a table in this scenario.

    There is a similar request on supporting dynamic content in File&Table inputs for connector Excel Online, please feel free to vote the idea at here:

    https://powerusers.microsoft.com/t5/Flow-Ideas/Dynamic-content-in-File-amp-Table-inputs-Excel-Business/idi-p/107821

     

     

    Best regards,

    Mabel

  • Community Power Platform Member Profile Picture
    on at

    Question... in the next to last step:

     

    You write:

    Within the Apply to each, add a Condition with the following code to get the Max one:

    @equals(ticks(items('Apply_to_each_2')?['LastModified']), outputs('Compose'))

    But, when I add a condition, it looks like this:

    condition.jpg

    How can I add "@equals(ticks(items('Apply_to_each_2')?['LastModified']), outputs('Compose'))" when it is asking for a value that is equal to (or some other condition) to some other value? I don't see a way of simply adding "@equals(ticks(items('Apply_to_each_2')?['LastModified']), outputs('Compose'))"

     

    thanks in advance.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard