HTML5 Data Bindings Formatter Support Product Page
Solved
Is it possible to Group By user_id, but have username come up in the table?
Reported 02 May 2014 23:54:43
1
has this problem
02 May 2014 23:54:43 Mike Trapp posted:
I am trying to create a list of students grouped by their parent. My parents are identified by a user_id, which is being used by the {{name}}. I would prefer to show the parents last name. If I group by parents last name, then the table groups all the students with the same last name under one heading, even though they have different parents.Is there a way to group by user_id, but show parents last_name?
Thank you
Replies
Replied 06 May 2014 15:02:21
06 May 2014 15:02:21 Teodor Kuduschiev replied:
Hello Mike,
I am afraid this is not possible as the {{$name}} binding used in the repeat region returns the user_id value.
I am afraid this is not possible as the {{$name}} binding used in the repeat region returns the user_id value.
Replied 06 May 2014 21:45:46
06 May 2014 21:45:46 Mike Trapp replied:
Thank you for your response. I was thinking this was the way it worked.
Is there a way to get the user_id from the {{$name}} that I can use for a query
( select * from users where user_id = $name ) ?
Is there a way to get the user_id from the {{$name}} that I can use for a query
( select * from users where user_id = $name ) ?
Replied 10 Apr 2015 01:15:44
10 Apr 2015 01:15:44 Steve Skinner replied:
I just ran into this problem too. In showing work orders grouped by user, it's logical to use user ID as the filter, but you'd still want to show the names. Also, grouping by name instead of user ID isn't a good idea because you can have many users with the same first or last name.
It would be REALLY helpful to be able to group by user ID, but show the first and last name of the user when listing work orders by user. No one identifies each other by user ID....
It would be REALLY helpful to be able to group by user ID, but show the first and last name of the user when listing work orders by user. No one identifies each other by user ID....
Replied 14 Apr 2015 09:34:14
14 Apr 2015 09:34:14 Teodor Kuduschiev replied:
Hi Steve,
Could you please explain a little more detailed what exactly do you need to achieve?
Could you please explain a little more detailed what exactly do you need to achieve?
Replied 14 Apr 2015 14:47:10
14 Apr 2015 14:47:10 Steve Skinner replied:
Here's my test page:
www.reliable-service.com/sandbox/userCompletedWO.asp
This is a list of work orders, grouped by user ID, which is the right way to do this because user ID's are the only thing about users that are unique. The problem is that I want to show the user's first and last name where each user ID is shown above the records. I've put in the user's name at the end of each line to verify that it is grouping correctly.
Is there no way to show the user's name where the user ID is?
www.reliable-service.com/sandbox/userCompletedWO.asp
This is a list of work orders, grouped by user ID, which is the right way to do this because user ID's are the only thing about users that are unique. The problem is that I want to show the user's first and last name where each user ID is shown above the records. I've put in the user's name at the end of each line to verify that it is grouping correctly.
Is there no way to show the user's name where the user ID is?
Replied 30 Sep 2015 09:05:03
30 Sep 2015 09:05:03 Teodor Kuduschiev replied:
Hi Steve, Mike
sorry for the late reply i was just working on this and came across this topic.
Steve,
In your repeat regions change:
To:
This will give you the First and Last names instead of the ugly id.
Mike it is the same for you - just use last_name:
sorry for the late reply i was just working on this and came across this topic.
Steve,
In your repeat regions change:
<p>{{$name}} -- </p>
To:
{{$value[0].nameF}} - {{$value[0].nameL}}
This will give you the First and Last names instead of the ugly id.
Mike it is the same for you - just use last_name:
{{$value[0].last_name}}
Replied 30 Sep 2015 14:50:29
30 Sep 2015 14:50:29 Steve Skinner replied:
Better late than never I guess, but this works perfectly. Thank you Teodor!
One question:
Would it always be "value[0]." that needs to be added to accomplish this or would that value number ever be something other than a zero? Just curious...
Again, thank you. I love solutions!
One question:
Would it always be "value[0]." that needs to be added to accomplish this or would that value number ever be something other than a zero? Just curious...
Again, thank you. I love solutions!
Replied 30 Sep 2015 17:49:24
30 Sep 2015 17:49:24 Teodor Kuduschiev replied:
Yes, it should always be {{$value[0].