cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
JDANILOM
Level: Powered On

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
Level 10

Re: Doubt Sort Function

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
Level 10

Re: Doubt Sort Function

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
thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors
Users online (5,267)