cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mattw112IG
Impactful Individual
Impactful Individual

Sorting a list of dates

In dynamics I have a bunch of date fields on a form.

 

I want to run a flow and return what is the next date in the future.

 

So if today is 9/15/2021 and the dates form various fields are:

 

9/14/2021

9/24/2021

9/30/2021

9/18/2021

9/16/2021

 

I would want 9/16/2021 returned.

 

I'm assuming I can read these from Dynamics and build an array?  Although many times not all of the field will contain a date, some may be blank... so would need to grab the fields that arent blank, add to an array, run some sort of sort, and return the result??

 

Does anyone have an example of this i can use or some guidance on the approach?

 

Thanks,

Terry 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @Mattw112IG :

I've made a test for your reference:

1\My SP list:

vbofengmsft_0-1632104130286.png

2\My Flow(On my side today is 9/20/2021)

vbofengmsft_3-1632104231208.png
vbofengmsft_2-1632104207819.png

vbofengmsft_4-1632104247959.png

The Result

vbofengmsft_5-1632104266289.png

Best Regards,

Bof

 

 

View solution in original post

2 REPLIES 2
Mattw112IG
Impactful Individual
Impactful Individual

no ideas?

v-bofeng-msft
Community Support
Community Support

Hi @Mattw112IG :

I've made a test for your reference:

1\My SP list:

vbofengmsft_0-1632104130286.png

2\My Flow(On my side today is 9/20/2021)

vbofengmsft_3-1632104231208.png
vbofengmsft_2-1632104207819.png

vbofengmsft_4-1632104247959.png

The Result

vbofengmsft_5-1632104266289.png

Best Regards,

Bof

 

 

View solution in original post

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!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Kudoed Authors
Users online (2,588)