사용자 정의 필드 자동화로 그룹에 사용자 추가하기

:bookmark: 이 가이드는 사용자가 가입 또는 프로필 업데이트 시 사용자 정의 필드를 선택한 내용에 따라 사용자를 자동으로 그룹에 추가하는 방법을 설명합니다.

:person_raising_hand: 필요한 사용자 권한: 관리자

요약

  1. 필요한 그룹 생성
  2. 사용자 정의 필드 설정
  3. 사용자를 그룹에 추가하는 자동화 생성
  4. 설정 테스트

그룹 생성

먼저, 사용자가 자동으로 추가되길 원하는 그룹을 생성하세요:

  1. 사이트의 관리자 영역으로 이동합니다.
  2. 관리자 사이드바에서 '그룹’으로 이동하거나 /admin/groups를 방문합니다.
  3. 생성하려는 각 그룹에 대해 '새 그룹’을 클릭합니다.
  4. 자동화 스크립트가 이 값을 사용하므로 각 그룹에 '전체 이름(Full Name)'을 반드시 추가하세요.

:information_source: 자동화 스크립트는 사용자의 사용자 정의 필드 값을 그룹의 **전체 이름(Full Name)**과 일치시킵니다. 각 그룹의 전체 이름이 해당 사용자 정의 필드 옵션과 정확히 일치하는지 확인하세요 (예: 드롭다운 옵션이 "cat"이라면, 그룹의 전체 이름은 "cat"이어야 합니다).

사용자 정의 필드 설정

다음으로, 사용자가 선택할 사용자 정의 필드를 생성합니다:

  1. 사이트의 관리자 영역으로 이동합니다.
  2. 관리자 사이드바의 커뮤니티 섹션에서 '사용자 필드(User Fields)'로 이동하거나 /admin/config/user-fields를 방문합니다.
  3. '사용자 필드 추가’를 클릭합니다.
  4. 적절한 옵션으로 필드를 설정합니다.

사용자 정의 필드의 예시는 다음과 같습니다:

:information_source: 그룹 전체 이름과 정확히 일치하는 사전 정의된 옵션을 가진 드롭다운 필드 유형을 사용하세요. 자유 텍스트 필드는 불일치를 일으킬 수 있습니다. 확인(confirmation) 필드 유형을 사용하는 경우, 값은 “true” 또는 "false"가 되므로 그룹의 전체 이름을 이에 맞게 설정해야 합니다.

자동화 생성

이제, 사용자의 사용자 정의 필드 선택에 따라 사용자를 그룹에 추가하는 자동화를 설정합니다:

  1. 사이트의 관리자 영역으로 이동합니다.
  2. 관리자 사이드바에서 '플러그인 > 자동화’로 이동하거나 /admin/plugins/automation을 방문합니다.
  3. '자동화 추가’를 클릭합니다.
  4. 스크립트로 '사용자 정의 필드를 통한 사용자 그룹 추가’를 선택합니다.
  5. 트리거를 선택합니다:
    • 가입 시 사용자를 그룹에 추가하려면 ‘사용자 최초 로그인’
    • 일정 간격으로 실행되어 사용자가 시간이 지남에 따라 그룹을 변경할 수 있도록 하려면 ‘반복’
  6. 드롭다운 메뉴에서 사용자 정의 필드를 선택합니다.
  7. 자동화 설정을 구성하고 활성화되도록 합니다.

자동화 설정의 예시는 다음과 같습니다:

:mega: 자동화에는 기존 사용자 정의 필드를 선택할 수 있는 드롭다운이 포함되어 있어 설정이 더 쉽고 오류 발생 가능성이 낮습니다.

설정 테스트

모든 것이 올바르게 작동하는지 확인하려면:

  1. 새 사용자로 가입하거나 기존 사용자의 프로필을 업데이트합니다.
  2. 생성한 사용자 정의 필드에서 옵션을 선택합니다.
  3. 가입 또는 프로필 업데이트 과정을 완료합니다.

가입 시 사용자 정의 필드가 어떻게 보이는지 예시는 다음과 같습니다:

자동화가 실행된 후, 사용자가 적절한 그룹에 추가되었음을 확인해야 합니다:

자주 묻는 질문(FAQ)

Q: 이 자동화로 사용자를 기본 그룹에 추가할 수 있나요?
A: 기본적으로 이 자동화는 사용자를 보조 그룹에 추가합니다. 그룹을 기본 그룹으로 설정하려면 그룹의 ‘관리 > 멤버십’ 설정 페이지로 가서 '기본 그룹으로 자동 설정’을 선택하세요.

Q: ‘반복’ 트리거를 선택하면 자동화는 얼마나 자주 실행되나요?
A: 자동화 생성 시 주기를 설정할 수 있습니다. 커뮤니티의 필요에 가장 잘 맞는 일정을 선택하세요.

Q: 사용자가 사용자 정의 필드 선택을 변경하면 어떻게 되나요?
A: 반복 자동화를 설정한 경우, 다음 실행 시 업데이트된 선택에 따라 사용자를 새 그룹에 추가합니다. 그러나 자동화는 사용자가 이전 그룹에서 제거하지 않습니다 — 추가만 수행합니다. 필요할 경우 그룹 제거는 수동으로 관리해야 합니다.

Q: 자동화는 사용자를 어떤 그룹에 추가할지 어떻게 알까요?
A: 자동화는 사용자의 사용자 정의 필드 값을 각 그룹의 **전체 이름(Full Name)**과 일치시킵니다. 자동화 설정에 명시적인 그룹 선택 항목은 없으며, 일치 과정은 전체 이름에 기반하여 자동으로 이루어집니다.

추가 자료

15개의 좋아요

This Automation has now been tweaked to include a dropdown to select your existing User Custom Fields from. :partying_face:

No more rooting around in the user custom field json trying to find an id number, or any awkward typos snarling things up. Just super smooth and friendly UI. :sunglasses:

7개의 좋아요

Pls the automation can only add users to the secondary group, what should I do if I want to add him to the primary group?

I think this would be set on the group’s Manage/Membership setting page where you can select ‘Automatically set as primary group’.

2개의 좋아요

What am I missing?

Did all of this but it is not working as expected after testing.

Do you need to match the “full name” of the group to the automation name option? i.e. I see no option to pick the group you want to the user to be added to on trigger event.

I’m missing a step or something is not clicking in my head.

2개의 좋아요
3개의 좋아요

Thanks, and so deleted all previous setups, sync name fields and tested signup. Still no success.

To confirm, you use the Group “full name” not the @name?

To add, I also changed the automation to recurring so I could trigger the automation manually and this also has not worked.

I just created everything from scratch:

  1. My custom user field “Pet team”:

  2. The new groups: Name “cat-lovers”, Full name “cat” and Name “dog-lovers”, Full name “dog”

  3. The automation: (I chose every 1 minute for fast testing)

  4. Testing

    1. Choosing “cat” for “Pet team” in my profile preferences
    2. Checking the group membership:
    3. Choosing “dog” for “Pet team” in my profile preferences
    4. Checking the group membership:
2개의 좋아요

I was originally going to post a new topic “how to filter user signup before : after” so all new users from X day go into X group

However, I found this topic and decided it was what I needed.

The difference in my use case is to your example (thank you again) which is possibly even simpler, there is no need for multi chocie so the user only have to tick a “confirmation” :white_check_mark: and that confirmation field fix the users to X group

1개의 좋아요

Also I can see the test user and the X filed = true in the user profile, so that works on signup.

AS outlined above in my case use there is only cat option and it is assigned by “confirmation” click, it is a mono filter requirement.

Maybe I’ll try force it using drop down instead and see if it works.

I also got a working automation using a confirmation custom user field.

1개의 좋아요

Ok that was it, I changed custom user field to dropdown with only one option and it worked.

I can not replicate! :grinning:

1개의 좋아요

Does this help? Maybe you can spot the difference

The user field


The automation

The group

2개의 좋아요

Your Group name is “true” ?

Yes, it must match the value of the custom user field. A confirmation field is either ‘true’ or ‘false’.

3개의 좋아요

Ok, that is what I was thinking was going on.

It strikes me then you are then limited to one group called “true” and you can never user that “confirmation” approach again.

I will run with the drop down for now as I might want to change the group filter on say an annual basis, i.e. a group for each year.

Finally, if I can suggest to the makers of the automation, to perhaps consider a more explicit step and thus field, to specify the intended user group that is the target of your filter, as this implied part of the setup has caused me a lot of confusion and time as it probably as others.

Thank for all your help and exposé @Moin

3개의 좋아요

I noticed some mistakes in the documentation:

Actually, user fields are located in the community section of the admin sidebar.

Automation is implemented as a plugin, so you will find it under Plugins rather then under Customize.

In general, the screenshots and the navigation seem a little outdated. Also, the common term seems to be “custom user field,” and this guide often uses “user custom field” instead.

Some time ago, I suggested an alternative version that reflects most of these points. I’m sharing it here now so it can help someone in case they’re struggling with these aspects.

My draft

: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

  1. Set up a custom user field
  2. Create the necessary groups
  3. Create an automation to add users to groups
  4. Test the setup

Setting up the custom user field

First, create a custom user field that users will select from:
(There is also a detailed guide on user fields)

  1. Go to your site’s Admin area
  2. Navigate to User fields using the link in the community section of the admin sidebar or by visiting /admin/config/user-fields
  3. Click “Add user field”
  4. Set up the field with appropriate options

Here’s an example of how your user field might look:

:information_source: The automation assigns users to a group if their input in the custom field exactly matches a group’s full name. To ensure accuracy, use a dropdown with predefined options that match group names exactly. Free text fields can cause mismatches. If using a confirmation field, groups need to be named ‘true’ or ‘false’.

Creating the groups

Next, create the groups you want users to be automatically added to:
(There is also a detailed guide on creating groups)

  1. Go to Groups by using the link in the admin sidebar or adding /g or /groups to your forum’s URL.
  2. Click “New Group” for each group you want to create
  3. Make sure to add a “Full Name” for each group, as the automation script uses this

:information_source: The automation script uses a group’s Full Name, so ensure it exactly matches the input in the custom user field.

Creating the automation

Now, set up the automation to add users to groups based on their custom user field selection:

  1. Go to your site’s Admin area
  2. Navigate to Plugins > Automation
  3. Click “Add automation”
  4. Select “Add user to group through User Custom Field” as the script
  5. Add a name
  6. Choose a trigger:
    • “User first logged in” to add users to groups at signup
    • “Recurring” to run on a schedule, allowing users to change groups over time
  7. Choose your user custom field from the dropdown menu
  8. Don’t forget to enable your automation

Here’s an example of how your automation setup might look:

Testing the setup

To ensure everything is working correctly:

  1. Sign up as a new user or update an existing user’s profile
  2. Select an option from the custom user field you created
  3. Complete the signup or profile update process

Here’s an example of how the user field might appear during signup:

After the automation runs, you should see the user added to the appropriate group:

FAQs

Q: Can this automation add users to primary groups?
A: By default, this automation adds users to secondary groups. To set a group as primary, go to the group’s Manage > Membership settings page and select “Automatically set as primary group”.

Q: How often does the automation run if I choose the “Recurring” trigger?
A: You can set the frequency when creating the automation. Choose a schedule that best fits your community’s needs.

Q: What happens if a user changes their custom user field selection?
A: If you’ve set up a recurring automation, it will update the user’s group membership based on their new selection during the next run.

Q: Can I use more than one automation based on a confirmation fields?
A: Yes! While both groups’ full names must be ‘true’ or ‘false’, you can create multiple groups with different names to distinguish them. When setting up the automation, simply select the respective custom field for each one.

Additional resources

If I updated the documentation now, I would also add that there are issues when using a multi-select custom user field

4개의 좋아요

이렇게 설정해 두었는데, 사용자가 사용자 필드 드롭다운에서 선호도를 변경할 때 초기에 선택한 그룹에서 제거되지는 않지만, 새로 선택한 그룹에는 추가되는 것을 확인했습니다. 이것이 예상되는 동작인가요?

즉, 사용자가 그룹에 추가된 이후에는 자동화를 통해 해당 그룹에서 사용자를 제거할 방법이 없는 건가요?

1개의 좋아요

사용자 정의 필드가 여러 옵션을 가진 드롭다운인 경우에도 시스템이 여전히 전혀 작동하지 않습니다.

1개의 좋아요