Sort By User Problem

Hi,

Quick question about sorting.

So every table created has a Creator field right, and if I wanted to display data through means of using a repeating group than I can do that easily enough and specify any particular sorting fields/conditions that I want.

But, say I want to display some users in my repeating group but I always want the current user to appear at the top, is this possible?

(for each person viewing the page they would see their own name at the top)

.

To give a visual example, I have this scenario…

I’m Paul and I just happen to appear at the top of the list, but if either Vonny or Ella log in, I want them to see their names appearing at the top of that list and not mine.

I couldn’t find an easy way of doing it. I thought maybe I could record each users unique id as a text entry in the table I’m working with but I didn’t get too far trying that and I’ve just been looking at various other sorting methods and conditions on cells etc but one way or other I keep running into problems.

It doesn’t seem to be as easy as I thought! unless I’m just having a dumb moment

image

1 Like

Have you tried this:
For your search, first do a search for just the current user, then merge with a second search for the rest, making sure to exclude the current user.

2 Likes

Interesting, I never thought of that approach. I’ll give that a try. Thanks very much.

@SerPounce’s idea should work though instead of doing a search for the current user you can simply do ‘current user:converted to list: merged with’.

Another idea is to simply create a standard group at the top formatted like the RG cells with a data source of current user to show your current user. Then put your RG below that and do your search for users where ‘unique id <> current user’s unique id’

3 Likes

Great ideas there, didn’t think of any of these, thanks a lot for the input.

I think you can sort on creation date, modified date but also a custom value. You might try the custom value.

1 Like

Hello @pork1977gm,

Did you figure out how to resolve your problem ? I have the same type of problem in my app and I would be awesome if you share some insights about the tested solutions !

For info, I tried the option of SerPounce, but I got the same list in the same order in my RP …

Thanks a lot

Hi Audric,

I managed to make it work how I wanted it to by using 2 searches and then using ‘merged with’ between them. The first search contains the current user and the second search contains all users apart from the current user.

Image below shows the data source for the first search, the second one is the same but using ‘Created By <> Current User’

Seems to work well

Paul

2 Likes

Thanks for your help, I tried this solution and it’s working well also !