cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TechToAssist
New Member

Need to sort HTML table as per date and time column in flow

Hello,

 

I have a flow which is getting data from a SharePoint list > Putting it in a HTML table > Compose > Sending it via email. The compose step has below expression to format the table. The list has a date and time column and I am trying to format the table according to it. Currently, it shows oldest item on top but i am trying to get the newest item on top. Any help would be greatly appreciated. 

 

replace(body('IncidentTable'),'<table>','<table style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; width: 1250px ;border-collapse:collapse;padding :5px ;cellspacing :5px;border:2px solid #000;" border ="1" align="Left">') 

5 REPLIES 5
efialttes
Super User III
Super User III

Hi! I guess you are using 'Get items' action block to read your SP list, right?

If so, you can play with'Get items' 'Order by' input. LEt's imagine you need to show the results based on the date & time items were Created in descending order (newest first). THen you just need to type

Created desc

If you wanna order your results by evaluating a different column, just replace 'Created' and use your target internal column name instead

Hope this makes sense



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Hi 

 

 

Hi!

Can you share a screenshot from your current flow design, so I can inspect the ODATA Expression you assigned?

Thanx!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



here you go! 

 

This is the internal name of the column: 

 

Internal name of the columnInternal name of the column

 

ODATA expression. 

 

2.JPG

 

I tried adding it with quotes 'Start_x0020_Time' but no luck. I tried adding it from Dynamic Contents as well still got the error. 

Mmmm... your syntax is apparently correct, according to this thread

https://powerusers.microsoft.com/t5/Building-Flows/Sytnax-for-Odata-Order-By/td-p/55185

 

Did your 'Filter query' work before adding 'Order by'? Or, did you added both of them at the same time?

Are you sure of the internal column name? An easy way to verify it is to edit your flow, then add a Filter array just after your 'Get items', then select from Dynamic content menu the target column, then hover the mouse over it and this way Flow editor will show it.

Hope this helps

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

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

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,538)