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

 

 

Helpful resources

Announcements
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.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (3,135)