# Add users to groups on signup

**URL:** https://meta.discourse.org/t/add-users-to-groups-on-signup/245667
**Category:** Support
**Tags:** user-custom-fields
**Created:** [November 15, 2022, 3:50pm UTC](https://meta.discourse.org/t/add-users-to-groups-on-signup/245667 "2022-11-15T15:50:13Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![jo-andre](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jo-andre/32/291047_2.png) [@jo-andre](https://meta.discourse.org/u/jo-andre)
#### Post date: [November 15, 2022, 3:50pm UTC](https://meta.discourse.org/t/add-users-to-groups-on-signup/245667/1 "2022-11-15T15:50:14Z")

</div>

Am starting a private Trademans forum. And i want to put up a poster with invite codes. not just one.  
one for each group.  
lets say one of the invite codes are PLUMBER2020 for Plumber’s and when signing up with that code you get put in the Plumber group. and so on.

Its possible that feature is already build in, but i cant figure it out.

feel free to change the title as its one exicly like it from earlier

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [November 15, 2022, 4:06pm UTC](https://meta.discourse.org/t/add-users-to-groups-on-signup/245667/3 "2022-11-15T16:06:46Z")

</div>

You could generate a separate invite link that would add each to a specific group (and direct them specific to a topic too). You can find out more about those in [Invite users to a group](https://meta.discourse.org/t/invite-users-to-a-group/15544).

Another way could be to automatically join people to a group on signup using the [Automation](https://meta.discourse.org/t/discourse-automation/195773) plugin. With that, you can set it up so selecting an option from a custom field when they create an account would auto-enrol them into a particular group.

---

<div class="post-metadata">

### Author: ![jo-andre](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jo-andre/32/291047_2.png) [@jo-andre](https://meta.discourse.org/u/jo-andre)
#### Post date: [November 15, 2022, 4:13pm UTC](https://meta.discourse.org/t/add-users-to-groups-on-signup/245667/4 "2022-11-15T16:13:21Z")

</div>

> [@JammyDodger](#):
>
> Another way could be to automatically join people to a group on signup using the [Automation](https://meta.discourse.org/t/discourse-automation/195773) plugin. With that, you can set it up so selecting an option from a custom field when they create an account would auto-enrol them into a particular group.

Yes! @JammyDodger😃 This looks just right! Thanks a lot, i will probably ask for suggestions later on 😅 For now thank you 🙂

---

<div class="post-metadata">

### Author: ![jo-andre](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jo-andre/32/291047_2.png) [@jo-andre](https://meta.discourse.org/u/jo-andre)
#### Post date: [November 17, 2022, 3:13pm UTC](https://meta.discourse.org/t/add-users-to-groups-on-signup/245667/5 "2022-11-17T15:13:30Z")

</div>

Hey again.  
ive got some problems getting started. if someone could make a tutorial on how to set this up that be great,  
Here are some screen shots on my progress. 😅

 ![bilde](https://global.discourse-cdn.com/meta/original/4X/0/5/8/058bc21f4702e0d3c990db26bdc62fb31e57eca7.png)  
 ![bilde](https://global.discourse-cdn.com/meta/original/4X/2/b/c/2bcafbb9ec20f04237f3263206e96a5314e9e625.png)  
 ![bilde](https://global.discourse-cdn.com/meta/original/4X/3/5/a/35a0b78a9159fc44c524cb8fc1c7ce0a233c454c.png)

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [November 17, 2022, 3:22pm UTC](https://meta.discourse.org/t/add-users-to-groups-on-signup/245667/6 "2022-11-17T15:22:46Z")

</div>

Ah, yes. I forgot about the ‘User Custom Field Name’ quirk. 🙂 There’s a bit of a write up about it in this topic that you may find helpful:

> [@Finding Userfield Custom Name for 'Add user to group through User Custom Field'](https://meta.discourse.org/t/finding-userfield-custom-name-for-add-user-to-group-through-user-custom-field/241608/2):
>
> Hi Andy! One of our hosted customers also recently asked a question about how exactly to configure the Add user to group through User Custom Field automation. I’m putting a generic version of the answer here for the benefit of our wider ecosystem, as the UX is admittedly not very friendly at the moment - apologies for that while we work to improve it. How to set up the Add user to group through User Custom Field Automation script First you need to create a user field from Customize → User Fiel…

Though feel free to ask more questions if that doesn’t answer everything. 👍 🙂

And, just in case it’s useful, here’s the guide for adding a User Custom Field:

> [@Creating and configuring custom user fields](https://meta.discourse.org/t/create-and-configure-custom-user-fields/113192):
>
> bookmark This guide explains how to create and configure custom user fields in Discourse, including how to add them to the signup form, user profiles, and user directory. person_raising_hand Required user level: Administrator Custom user fields allow you to collect additional information from your users beyond the standard profile fields. These fields can be displayed on user cards, user summary pages, and even retrieved using the [Data Explorer](https://meta.discourse.org/t/32566?silent=true) plugin. This guide will walk you through th…

---

<div class="post-metadata">

### Author: ![jo-andre](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jo-andre/32/291047_2.png) [@jo-andre](https://meta.discourse.org/u/jo-andre)
#### Post date: [November 17, 2022, 3:26pm UTC](https://meta.discourse.org/t/add-users-to-groups-on-signup/245667/7 "2022-11-17T15:26:04Z")

</div>

Your amazing!! Thank you 💚

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [August 19, 2023, 7:56pm UTC](https://meta.discourse.org/t/add-users-to-groups-on-signup/245667/8 "2023-08-19T19:56:27Z")

</div>

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

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [November 3, 2023, 4:19pm UTC](https://meta.discourse.org/t/add-users-to-groups-on-signup/245667/9 "2023-11-03T16:19:40Z")

</div>

For future travellers, there’s now a guide with some updated instructions on how to use this Automation 👍

> [@Add users to groups through custom field automation](https://meta.discourse.org/t/add-user-to-group-through-custom-field-automation/275873/1):
>
> bookmark This guide explains how to automatically add users to groups based on their selection of a custom user field during signup or profile update. person_raising_hand Required user level: Administrator Summary Create the necessary groups Set up a custom user field Create an automation to add users to groups Test the setup Creating the groups First, create the groups you want users to be automatically added to: Go to your site’s Admin area Navigate to Groups in the admin sidebar…
