Ability to Select Multiple Options on a Dropdown User Field

I’m wondering if there is a way for users to be able to select multiple options from a custom dropdown list. For example, admin is able to create a custom user field as dropbdown list; however, currently a user is able to select only one option from the dropdown. It would be great to allow the user to selecti multiple options from the dropdown list.

Has anyone done this before? Does the current version of Discourse allow it?

Thanks.

This isn’t supported at the current time.

Would this be #pr-welcome? I would be willing to take this on if it is. Otherwise, we’ll likely build a plugin for it.

1 Like

Is there a specific use case for core? What is the specific use case for your plugin?

2 Likes

We’re using User Fields as a way to help users find each other. So it would allow business owners to locate marketers or web devs. The key is allowing users to choose what they want to be known as within the community and in most cases we assume users will want to select multiple roles.

So one user can select “Business Owner” and “ Marketer” as their expertise (User Field).

From a plugin stance, I could see this as an entrance into more flexibility on the Group Pages, too. I know I have done a few of those projects already. We customized the group user list or the user directory to include User Fields.

2 Likes

I think the best approach here is start by building it in your plugin, then share some screenshots etc with us and @joffreyjaffeux can review.

I am uneasy adding any component into core that is never used by core.

3 Likes

That’s fine. We can do that.

How are User Fields used by core currently? I thought they were only used by admins to configure extra data on users.

In my case, it would be admins configuring extra data as well as these selected userfields would automatically show up on the user’s profile, helping them stand out among other users.

I hadn’t thought of the additional use suggested by @joebuhlig in that these userfields can be a huge help in users searching for and finding each other based on what they have specified in their drop-down menu style userfield with multiple options.

For those interested, here’s the plugin we developed for this:

https://github.com/procourse/discourse-multiselect-user-field

We’ll look into submitting a proper PR on this at some point in the future. But for now, this serves our purposes.

3 Likes

Hey Joe,

Thanks so much for creating this plugin. This is pretty essential for us… I got it working, but the output looks a bit funky: Multi: [“One”,“Two”,“Three”]

It would be great if the output looked more normal, like: One, Two, Three

Any pointers on how to tweak that myself?

Thanks! :sunglasses:

Makes sense to me. I’ll get this added to the ProCourse queue. But like I mentioned elsewhere, this one isn’t on the list of ProCourse owned plugins, so it’ll have to be done as we can get to it.

3 Likes

Awesome. Thanks for taking a look. :grinning:

1 Like