Skip to Content Skip to Menu

Userlist - combining multiple columns

  • mduda
  • mduda
  • OFFLINE
  • Posts: 14
  • Thanks: 2
  • Karma: 0
7 years 3 months ago #295381 by mduda
Replied by mduda on topic Userlist - combining multiple columns
I need to union all some columns before showing them in the list.

Need to have all fields listed under one column in the frontend userlist - I only want to show one column for:

Teacher (cb registration has fields for teacher1, teacher2, teacher3, and teacher4)
Student (cb registration has fields for student1, student2, student3, and student4)

Is there a way to union all the teacher columns and student columns in the comprofiler table before showing them in the userlist?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8280
  • Karma: 1443
7 years 3 months ago - 7 years 3 months ago #295384 by krileon
Replied by krileon on topic Userlist - combining multiple columns
You can substitute them into a Custom HTML field then display that Custom HTML field on your userlist. See the below on how to substitute fields.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb

Your only other option is to use CB Query Field and query for the fields you want and using SQL you can combine them. It's probably easier to just add those fields to a column on your userlist and they'll display 1 after another.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 7 years 3 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • mduda
  • mduda
  • OFFLINE
  • Posts: 14
  • Thanks: 2
  • Karma: 0
7 years 3 months ago - 7 years 3 months ago #295523 by mduda
Replied by mduda on topic Userlist - combining multiple columns
I just utilized the substitution to put city and state together. Very cool :)

I'm still trying to grasp if I can really utilize the substitution for this specific case though...

If I add a custom html field called cb_allteachers. And include teacher1, teacher2, teacher3, and teacher4. And then add another custom html called cb_allstudents, and include student1, student2, student3, and student4.

I will filter the userlist using cb_allteachers. Keeping in mind that student1 is in teacher1's class, student2 is in teacher2's class, etc. How can I correctly display the student with their assigned teacher? Am I missing something?

What I have currently and what I'm trying to achieve. Hoping this is possible in cb.


Thanks in advance!
Attachments:
Last edit: 7 years 3 months ago by mduda. Reason: adding image

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8280
  • Karma: 1443
7 years 3 months ago #295542 by krileon
Replied by krileon on topic Userlist - combining multiple columns
If the student is just a field on the teachers profile then just display that student field in a column of your userlist. Sorry, but I still don't understand how you're connecting all of this. Is the student just a text field the teacher fills out? If so there's no issues regarding what student goes where as it's already attached to that teachers profile so you'd just display the field however you like.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • mduda
  • mduda
  • OFFLINE
  • Posts: 14
  • Thanks: 2
  • Karma: 0
7 years 3 months ago #295548 by mduda
Replied by mduda on topic Userlist - combining multiple columns
The parent completes the form (part of registering on the site). The parent inputs into text boxes each of their students' names and then selects a teacher from a dropdown list - for each student.

On the userlist - I'm trying to filter and display everything by teacher for all registered users (1000+ users, each with multiple students) (seems like I would need to "union all" the data, but not sure how in cb...or if there's another way.).

Do you think I can use substitutions for this? I'm still unclear if I do a substitution for all four of a parent's students, and then filter on the userlist by teacher, how this will keep each student with the correct teacher?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8280
  • Karma: 1443
7 years 3 months ago #295569 by krileon
Replied by krileon on topic Userlist - combining multiple columns
If the teacher is just a select field you don't need to union anything. Just add a Filter to your userlist for the teacher field or set the teacher field as searchable and they'll be able to search for the all students of the selected teacher. If you mean you want to group users together by teacher you'd add an Sorting to your userlist on the teacher field.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum