<h2>Associate additional fields/data with user groups</h2>
<p>You can't define a field layout for user groups, as user groups don't support custom fields. User groups are not much more than a way to categorize users and provide different sets of default permissions. They aren't elements, so they don't support field layouts or custom fields.</p>
<p>If you need to associate custom data with specific user groups, I would use entries for that. Two good options:</p>
<ol>
<li>Create one single section for every user group (using predictable naming for the section handle based on the user group handle) and add your custom fields to that. If you need <em>different</em> fields for every user group, this is the way to go.</li>
<li>Create a channel section and entry type to hold the custom user group fields. Then create one entry for every user group, setting each entry's <code>slug</code> to a user group handle. If all user groups can share the same fields, this is a bit quicker to set up and maintain.</li>
</ol>
<h2>Show different profile fields based on user groups (original answer)</h2>
<p>All users share the same field layout, which you can define in the backend under <strong>Settings → User Settings → User Profile Fields</strong>. You can still show or hide specific fields or layout tabs using <a href="https://craftcms.com/docs/5.x/system/fields.html#tabs" rel="nofollow noreferrer">field conditionals</a>.</p>

CC BY-SA 4.0
2024-06-20T11:07:00.763Z
Thank you, but what i mean is not directly user based is more group based i want only a layout for a group that doesn't impact the users of this group. 
Ex.: the group is a company and users of this group are workers of this company. In my case i want some additional Information for this group/company not for the worker/user. Is it in this case also possible with field conditionals?
antdev
CC BY-SA 4.0
2024-06-24T09:23:54.200Z
@antdev No that's not possible, you can't add fields to user groups. I've added a new section to my answer with two alternative ways to solve this problem.
MoritzLost
CC BY-SA 4.0
2024-06-20T07:32:06.173Z
2024-06-24T09:22:31.433Z
2024-06-24T09:22:31.433Z
MoritzLost
<p>Is it possible to assign a field layout to user groups in Craft CMS 5?</p>
<p>The <code>UserGroup</code> class does not have a setFieldLayout method. Is there another way to achieve this?</p>

<users><user-groups><craft5>
Set Field Layout for User Groups
# Set Field Layout for User Groups

(Asked by: username_0 on 2024-06-19)

Is it possible to assign a field layout to user groups in Craft CMS 5?

The `UserGroup` class does not have a setFieldLayout method. Is there another way to achieve this?

**Tags:** users, user-groups, craft5


---

## 1 answers

### Answer by username_1 on 2024-06-20. Score: 2 | Accepted answer

## Associate additional fields/data with user groups

You can't define a field layout for user groups, as user groups don't support custom fields. User groups are not much more than a way to categorize users and provide different sets of default permissions. They aren't elements, so they don't support field layouts or custom fields.

If you need to associate custom data with specific user groups, I would use entries for that. Two good options:

1. Create one single section for every user group (using predictable naming for the section handle based on the user group handle) and add your custom fields to that. If you need *different* fields for every user group, this is the way to go.
2. Create a channel section and entry type to hold the custom user group fields. Then create one entry for every user group, setting each entry's `slug` to a user group handle. If all user groups can share the same fields, this is a bit quicker to set up and maintain.

## Show different profile fields based on user groups (original answer)

All users share the same field layout, which you can define in the backend under **Settings → User Settings → User Profile Fields**. You can still show or hide specific fields or layout tabs using [field conditionals](https://craftcms.com/docs/5.x/system/fields.html#tabs).

> **Comments:**
> **username_0**: Thank you, but what i mean is not directly user based is more group based i want only a layout for a group that doesn't impact the users of this group.  Ex.: the group is a company and users of this group are workers of this company. In my case i want some additional Information for this group/company not for the worker/user. Is it in this case also possible with field conditionals?  
> **username_1**: @username_0 No that's not possible, you can't add fields to user groups. I've added a new section to my answer with two alternative ways to solve this problem.  

---

