Answers.Body: <p>You could control which fields a user has access to based on their group from a front end edit profile page, but there is no way to do this in the admin outside of creating a plugin with a custom table and screens.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-19T20:49:12.553Z
Answers.Text: I am considering both options. I was digging through the default database to see how Craft relates users to their profile fields, but am having a hard time seeing how they create that relationship. I'm considering creating a custom plugin, but I would want to use crafts built in functionality to relate the users to the table entries. Do you have any knowledge on that?
Answers.UserDisplayName: Paul Kirby
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-19T21:05:41.067Z
Answers.Text: When setting up the plugin table you would create a userId field and then you would use foreign key "relationships" in the record to the link the user to the table. I would probably put all the field sin the same table and then just limit what fields the user can edit in UI based on the user's group. Its complicated you'll have to get into the docs and even look up some sample code to get a feel for how to set up a plugin.
Answers.UserDisplayName: Rick Kukiela
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-19T21:07:10.733Z
Answers.Text: There is a way to use the field layout stuff with your custom plugin but I dont have  experience with that. There is a 3 part video from a few years ago where they go over it. I would recommend watching that hangout, a few times.
Answers.UserDisplayName: Rick Kukiela
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-19T21:10:21.087Z
Answers.Text: https://straightupcraft.com/events/introduction-to-element-types-in-craft-cms-part-1-of-3
Answers.UserDisplayName: Rick Kukiela
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-19T21:12:57.797Z
Answers.Text: Thanks a lot! Its sound like what your suggesting in your first comment would essentially be the same thing I would do if I used the included profile fields with craft core, but it would also allow me to hide those specific fields in the CP, which I don't really need. I suppose the easiest route is to just create all necessary fields in the profile, and limit which ones they can submit in the front end based on what type of user they are trying to create.
Answers.UserDisplayName: Paul Kirby
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-19T21:14:13.593Z
Answers.Text: No prob glad I could help >:]
Answers.UserDisplayName: Rick Kukiela
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-19T20:35:07.620Z
Answers.LastActivityDate: 2017-06-19T20:35:07.620Z
Answers.UserDisplayName: Rick Kukiela
Body: <p>I understand this isn't possible from the Control Panel, I'm developing a custom plugin for this specific client project. Essentially these user groups won't need access to the Control Panelat all, but will have unique permissions within the site and will have a few custom fields. </p>
  
  <p>Can I create custom fields per user group? Or do I just need to create relationships between these fields and the users when they create their profile? Trying to figure out the proper way to go about this.</p>
  
  <p>EDIT:
  After watching the Element Type hangout as suggested, they explain why this isn't possible with the current implementation of User Groups, if you are curious.
  <a href="https://youtu.be/hU_wduMEimY?t=27m44s" rel="nofollow noreferrer">https://youtu.be/hU_wduMEimY?t=27m44s</a></p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-19T19:18:01.707Z
Comments.Text: Looking through the hooks documentation it doesn't seem like this functionality is supplied by default... maybe I'm missing something or thinking about this the wrong way.
Comments.UserDisplayName: Paul Kirby
Tags: <plugin-development><users><user-profile><craft-pro><user-groups>
Title: How would I create unique fields for different user groups programmatically?
ThreadText: # How would I create unique fields for different user groups programmatically?
  
  (Asked by: username_0 on 2017-06-19)
  
  I understand this isn't possible from the Control Panel, I'm developing a custom plugin for this specific client project. Essentially these user groups won't need access to the Control Panelat all, but will have unique permissions within the site and will have a few custom fields.
  
  Can I create custom fields per user group? Or do I just need to create relationships between these fields and the users when they create their profile? Trying to figure out the proper way to go about this.
  
  EDIT:
  After watching the Element Type hangout as suggested, they explain why this isn't possible with the current implementation of User Groups, if you are curious.
  <https://youtu.be/hU_wduMEimY?t=27m44s>
  
  **Tags:** plugin-development, users, user-profile, craft-pro, user-groups
  
  > **Comments:**
  > **username_0**: Looking through the hooks documentation it doesn't seem like this functionality is supplied by default... maybe I'm missing something or thinking about this the wrong way.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-06-19. Score: 1 | Accepted answer
  
  You could control which fields a user has access to based on their group from a front end edit profile page, but there is no way to do this in the admin outside of creating a plugin with a custom table and screens.
  
  > **Comments:**
  > **username_0**: I am considering both options. I was digging through the default database to see how Craft relates users to their profile fields, but am having a hard time seeing how they create that relationship. I'm considering creating a custom plugin, but I would want to use crafts built in functionality to relate the users to the table entries. Do you have any knowledge on that?  
  > **username_1**: When setting up the plugin table you would create a userId field and then you would use foreign key "relationships" in the record to the link the user to the table. I would probably put all the field sin the same table and then just limit what fields the user can edit in UI based on the user's group. Its complicated you'll have to get into the docs and even look up some sample code to get a feel for how to set up a plugin.  
  > **username_1**: There is a way to use the field layout stuff with your custom plugin but I dont have  experience with that. There is a 3 part video from a few years ago where they go over it. I would recommend watching that hangout, a few times.  
  > **username_1**: https://straightupcraft.com/events/introduction-to-element-types-in-craft-cms-part-1-of-3  
  > **username_0**: Thanks a lot! Its sound like what your suggesting in your first comment would essentially be the same thing I would do if I used the included profile fields with craft core, but it would also allow me to hide those specific fields in the CP, which I don't really need. I suppose the easiest route is to just create all necessary fields in the profile, and limit which ones they can submit in the front end based on what type of user they are trying to create.  
  > **username_1**: No prob glad I could help >:]  
  
  ---
  
  