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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

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 (1,137)