cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Prodigy
Post Prodigy

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

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

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

Highlighted

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

 

 

 

 

 

 

 

 

 

Highlighted

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

Highlighted

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.

 

Highlighted

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

Highlighted

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.

Highlighted

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (12,821)