cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Order by date, to find oldest

Hello,

 

I have a trigger on a list of events, it then checks a list of hosts to find who can do that new event.

 

The host list includes a "HostDate" which is basically when they last hosted an event.

 

I want to order the Get Items result by "HostDate", finding the one who hosted furthest back.  

 

Thought it was just entering 'HostDate' desc into the Order by field, but that doesn't work.

 

Any ideas?

 

Thank you,

2 REPLIES 2
v-bacao-msft
Community Support
Community Support

Hi @Anonymous,

 

Could you please share a full screenshot of the configuration of your flow?

Could you provide more details about "a list of event" and "HostDate"?

Before that, you could consider this method to find oldest "HostDate".

     1. First get all the "HostDate" through Get Items, use ticks() function to convert them into a number (this is the difference from a certain time).

    2. Then store them in an array and get the minimum value via min() function, which is the converted value of oldest "HostDate".

    3. Then use Condition to get all the contents of this oldest "HostDate".

 

Image reference:

16.PNG

Condition- Expression reference:

ticks(items('Apply_to_each_2')['HostDate'])

max(variables('HostDate'))

 

17.PNG

I don't know if this can solve your issue, please try it.

If not, please feel free let me know and hope to have more details.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
GabrielStJohn
Microsoft
Microsoft

Hey, @Anonymous!

Thank you for posting on the Flow Community Forum! It appears as though @v-bacao-msft would like some more information in order to further assist you properly with your issue. Please share any additional information that was requested in order to decrease the amount of time that it will take for you to be assisted!

Thank you for being an active member of the Flow Community!

-Gabriel
Flow Community Manager

- Gabriel
Community Manager
Power Automate | Power Virtual Agents
Super User Program Manager



Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Top Solution Authors
Users online (2,295)