# How does the 'Add user to group through User Custom Field' script work?

**URL:** <https://meta.discourse.org/t/how-does-the-add-user-to-group-through-user-custom-field-script-work/241612>\
**Category:** Product Support\
**Tags:** automation\
**Created:** [September 26, 2022, 1:28am UTC](https://meta.discourse.org/t/how-does-the-add-user-to-group-through-user-custom-field-script-work/241612 "2022-09-26T01:28:15Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![leonardo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leonardo/32/228634_2.png) [@leonardo](https://meta.discourse.org/u/leonardo)\
**Post date:** [September 26, 2022, 1:54am UTC](https://meta.discourse.org/t/how-does-the-add-user-to-group-through-user-custom-field-script-work/241612/4 "2022-09-26T01:54:36Z")

</div>

It will only make sense with Dropdown type user fields, because Multiselects allow choosing more than one value and the script does not support multiple groups as target. It’s doable, but it would complicate the logic a bit. PRs welcome 🙂

Caveat: never use this with a text user field, because users would then be able to choose any group to be added to. So far Dropdown is the only sane choice.

---

_[View the full topic](https://meta.discourse.org/t/how-does-the-add-user-to-group-through-user-custom-field-script-work/241612)._
