How to group based on a field with multiple values?

Hi, I’m new to Glide and starting with a simple project to learn. I work for a company that owns and operates multiple organizations. I want to create an all-companies directory and have been customizing one of the Glide templates to learn. So far it’s mostly gone well but I hit one thing I can’t figure out. In the list of all employees, I’m grouping by the associated company name through the related table. However, some employees work (fractionally) for multiple companies so I want them to show up in the group for each company they work for. Unfortunately, when an employee works for multiple organizations instead of appearing under “Company1” and “Company2” they show up on their own under “Company1,Company2”. I’ve explored documentation and community posts but haven’t found a solution. Any ideas?

Hola Stephen!

Maybe using a template column can be enough (I hope so)…

Something like this

Saludos

It cleans up the unique grouping, but doesn’t fully what I’d like to accomplish. Ideally I’d like employees to be found grouped into any organization they work for. I didn’t know about template columns though so this is helpful to learn. Thanks!

Hola de nuevo!

if you can give us an example with what you have and what you want to get (screenshots) we can help your better.

If you want a list item (employee) to show multiple times within the same list, you will need multiple rows. No way around that fact, especially with Glide’s native grouping. What your asking is to essentially create a duplicate row out of thin air.

I don’t have any good suggestions, short of showing only a list of companies and navigating into a company to view the related employees. Or create a separate filtered list for each company on the same screen (not scalable or ideal).

1 Like

You should be able to get it to work for them appearing for search or filter by company name, but as Jeff said, can’t get a giant list that’s grouped by company, and have people be listed multiple times in the single list. I would suggest not using the “grouping” feature by company if employees work for multiple companies. Rather have users get a list of employees by company by search and/or filter.

1 Like

This is helpful. I think you’ve all helped me understand that the grouping feature as it was implemented in the template isn’t appropriate for what I’m trying to do. Fortunately if someone goes through the “Companies” list they can click a company and see anyone associated that way. But for now I’ll just remove the grouping and have the “Employees” list just be a long alphabetical list of people, ungrouped. Thanks for everyone’s help. Excited to see such an active community as a new user!

6 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.