cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JR-BejeweledOne
Super User
Super User

Sort Question

I have been tasked to update the sort for a gallery.

 

It is currently sorted by the modified date to show the most recently modified items first.    Each item has the name of a developer in it and I have been asked to sort like this:

 

  1. By Developer with the logged in developer's items shown first
  2. By Modified date, with the most recent to oldest

 

I have the second part, but am not sure how to implement the first part.    All items will be shown but the logged in Developer's items should be shown first from most recent to oldest.

 

Example:

 

Example:

 

Developers:

 

Bill Gates

Steve Jobs

Jeff Bezos

 

Currently logged in developer Jeff Bezos

 

Items:

 

Jeff Bezos 7/5/2020

Jeff Bezos 7/1/2020

Jeff Bezos 6/3/2020

Bill Gates 6/24/2020

Bill Gates 5/15/2020

Steve Jobs 7/2/2020

Steve Jobs 4/28/2020

Steve Jobs 4/2/2020

 

Currently logged in Developer Steve Jobs:

 

Steve Jobs 7/2/2020

Steve Jobs 4/28/2020

Steve Jobs 4/2/2020

Bill Gates 6/24/2020

Bill Gates 5/15/2020

Jeff Bezos 7/5/2020

Jeff Bezos 7/1/2020

Jeff Bezos 6/3/2020

 

 

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
1 ACCEPTED SOLUTION

Accepted Solutions

OnStart of the App set a Variable:

Set(LoogedUser,User().FullName)

 

Create a Collection OnVisible of the Screen:

ClearCollect(MyCol,AddColumns(Datasource,"SortColumn",If(DeveloperColumn=LoogedUser,1,2)))

 

Filter the Gallery as:

SortByColumns(MyCol,"SortColumn","Date")

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

7 REPLIES 7
eka24
Super User III
Super User III

Additional information on your current formula would have helped.
But try:

SortByColumns( Datasource, "DeveloperColumn",  "DateColumn")

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Unfortunately that does not meet the criteria specified in my post.

 

I don't just need to sort by the developer, I need to sort by the developer so the currently logged in developer's items are at the top of the list and then sort by date.

 

Example:

 

Developers:

 

Bill Gates

Steve Jobs

Jeff Bezos

 

Currently logged in developer Jeff Bezos

 

Items:

 

Jeff Bezos 7/5/2020

Jeff Bezos 7/1/2020

Jeff Bezos 6/3/2020

Bill Gates 6/24/2020

Bill Gates 5/15/2020

Steve Jobs 7/2/2020

Steve Jobs 4/28/2020

Steve Jobs 4/2/2020

 

Currently logged in Developer Steve Jobs:

 

Steve Jobs 7/2/2020

Steve Jobs 4/28/2020

Steve Jobs 4/2/2020

Bill Gates 6/24/2020

Bill Gates 5/15/2020

Jeff Bezos 7/5/2020

Jeff Bezos 7/1/2020

Jeff Bezos 6/3/2020

 

 

 

 

 

 

 

 

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

OnStart of the App set a Variable:

Set(LoogedUser,User().FullName)

 

Create a Collection OnVisible of the Screen:

ClearCollect(MyCol,AddColumns(Datasource,"SortColumn",If(DeveloperColumn=LoogedUser,1,2)))

 

Filter the Gallery as:

SortByColumns(MyCol,"SortColumn","Date")

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

eka24
Super User III
Super User III

Please is the issue resolved

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

I haven't tried it yet.   Our records that we are working with have been migrated from SharePoint 2013 and the creators are shown as:

 

Last Name, First Name and not First Name Last Name.

 

I will have to use the Office365Users connector.   I will try it shortly



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

Thanks, I am sure this works, but I am using a gallery with forms and would have to redo my entire app for this.   I will figure something else out.



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

Can you mark the solution as resolved

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,437)