Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Sort an excel table

I have a simple flow that takes information from a form and adds it to an excel table, I would like the flow to proceed and sort the excel table by the date column, newest to oldest, before saving it.

I thought this would be quite straightforward but having spent the afternoon trying apparently it is not?


I have used:

   When a new response is submitted

   Get response details

   Add a row into a table


Can anyone enlighten me what next and how please?

Super User
Super User

Hi @Kevor 


Office Scripts would be the best bet.  Use the office script recording tool in Excel Online, record the actions you describe, give the script a name and call the office script action on the file you mention after you have inserted the row, if you really wanted to be efficient, insert the row and order the rows with an office script.  I have a few demos on my YT but the Microsoft docs are very good for this too with some good examples. Introduction to Office Scripts in Excel (


Please consider accepting my answer as a solution if it helps to solve your problem.


Please take a look and subscribe to my YouTube Channel for more Power Platform ideas and concepts, or take a look at my website. Thanks

Thanks for your reply, however whenever I try to record a script in Excel online I get the error "We're unable to save your script. An unexpected error occurred while generating and saving your script....."


I was able to record a macro in the desktop app of Excel but I can't seem to reference it within power automate.

Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,174)