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

Doubt Sort Function

Hi! I am developing an app for monitoring the team's vacation.
I'm using as a source a list called: "Vacations" in SharePoint.
I created a gallery according to the image and I would like it to be ordered according to the numbers in the image.
I need you to indicate which are the next employees to go on vacation.
In addition, in the company we can divide the holidays into two different periods, so he should consider the closest one to go on vacation.
In the Items function I used the following formula: Sort(Vacation, '1º Inicio'- Today ()> 0 Or '2º Inicio'-Today()>0) and got the following result:

Powerapps.PNG

 

1 ACCEPTED SOLUTION

Accepted Solutions
EricLott
Super User
Super User

I think you're looking for the DateDiff() function. You can use this:

Sort(Vacation, DateDiff(Today(), '1º Inicio', Days))

Docs here:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-dateadd-datediff

View solution in original post

1 REPLY 1
EricLott
Super User
Super User

I think you're looking for the DateDiff() function. You can use this:

Sort(Vacation, DateDiff(Today(), '1º Inicio', Days))

Docs here:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-dateadd-datediff

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (59,901)