Bulk Award a badge to a set of users

Badges are an excellent way to acknowledge someone who is doing a good job. Discourse now allows awarding a badge to a set of users.

If you go to the badges section in the admin panel, you’ll notice that a new button called “Bulk Award” is now available next to the “new” button:

After clicking it, you’ll be prompted to select a badge and get started:

Select the badge you want to award and upload a CSV file containing a list of user emails or usernames (one per line)

Then you’ll be prompted with this message:

Screen Shot 2020-01-15 at 11.39.25

Discourse will find matching users, award them the badge, and send them a notification.

47 Likes

This is cool.

I propose changing this language to “awarding a badge to a set of users”, as group has a specific meaning in Discourse and a bunch of random email addresses in a CSV isn’t it :wink:.

23 Likes

Very nice, This will be useful :slight_smile:

5 Likes

Awww Yiss, that’s very handy. Thanks :slight_smile:.

3 Likes

This is great, thanks for the feature :slight_smile:

5 Likes

Selecting them from a user list could be easier if possible. Good feature anyway.

5 Likes

Yes that’s my ideal idea. :grin:

Just press on users you want to award too.

2 Likes

Sorry, but I’m not 100% clear on this. Terminology I’m familiar with is:

enclosure, delimiter (the separator) and terminator

enclosure is often quotation marks
delimiter is often a comma
terminator is often a newline

eg.

"1", "Bob", "rkelly@gmail.com", "CA" 
"2", "Carol", "counselor@hotmail.com", "CA" 
"2", "Ted", "tman@yahoo.com", "FL" 

I doubt you mean

rkelly@gmail.com 
, 
counselor@hotmail.com 
, 
tman@yahoo.com 
1 Like

What I meant was:

rkelly@gmail.com,
counselor@hotmail.com, 
tman@yahoo.com

I edited the post.

6 Likes

When bulk-adding users to a group, the system expects a list of user names. When bulk-adding users to a badge, the system expects a .csv file with e-mail addresses.

Personally I prefer the list of usernames, as it’s a lot easier to get those from the forums without jumping through admin-y hoops, and I’ve got some Excel tricks that can spit out a copy-and-pastable list. I used to bulk-assign badges by bulk-adding a list to a temporary group, then changing the badge query to assign to that whole group. When ‘award a badge to a set of users’ popped up I’d hoped to cut out a step…

Is there any way to make the list-of-users method a valid alternative way to bulk-assign badges?

8 Likes

I agree we should be supporting both.

If the first item in the list has an “@”, then import by email, otherwise, import by username.

Also, we could be a little more lenient when it comes to the format of that list.

We could just require the emails/usernames to be on their own line and then do a split("\n"), remove any empty lines, remove any trailing “,” and remove any pair of single/double quotes (eg. gsub(/^['"]|['"]$/, "")).

9 Likes

I know it’s hard and starts to risk mission-creep, but I wonder if over time the admin UI could aim towards more consistency across all Admin bulk operations? For example when:

  1. Awarding Badges in bulk: Select badge then upload a CSV of users’ email addresses

  2. Adding users to a Group in bulk: Select group then paste a list of usernames or emails, one per line

  3. Inviting users to Discourse in bulk: Upload a CSV containing users’ email addresses (optionally specifying groups(s) to add them to and the initial post to show them)

Clearly these have areas of commonality but also areas of definite disparity where they are not doing the same thing. So how easy it is to work towards a consistent UI paradigm for all Admin bulk actions, I don’t know. But I thought I’d raise the issue here since it is being discussed.

Of all three variants, I’d say the nicest at the moment is the Bulk Add To Group ‘Paste a list of usernames or emails, one per line’.

Quite often I want to Invite several users (say 5-10) and the one-by-one invite method is a bit irritatingly slow, but the CSV invite method is a bit faffy and requires me to fire up another program, or edit CSV manually. Even if the CSV upload was kept for the really BIG bulk invites, it would be great to have an Invite Users dialog like the Bulk Add To Group one. Of course it could only accept email addresses, one per line, but this would be fine.

8 Likes

Thanks everyone for the feedback! :slight_smile:

We added username support here:

13 Likes

Though still not as simply as pasting a list of usernames into a box, that’s a great step forward from needing e-mails! Are there any plans to unify the bulk handling of adding users to groups or badges? I’m not a programmer, but that sounds like re-usable code to me :slight_smile:

2 Likes

Is it possible to award users a badge multiple times using this? It seems to not be supported according to my own tests.

Awarding a badge in bulk to a list of users doesn’t grant the ones that already had the badge a second time.

1 Like

If the badge’s “Can be granted multiple times” checkbox is checked (found in the bottom section of the badge admin page), you should be able to award the badge multiple times in this way.

3 Likes

I have it enabled, but with a CSV import (even only a list of usernames of people that already have the badge) it does not grant it again. I have to manually grant the badge to the user before it shows up as being granted multiple times.

2 Likes

Can you award a badge to just one or two people manually rather than upload a CSV?

For some reason the “enthusiast” which is log-in for 10 consecutive days is not working for someone who has logged in for 12 consecutive days.

1 Like

I think that badge is pretty reliable, but sometimes the difference between timezones and UTC can make it appear otherwise.

I don’t think you can manually grant that badge currently, but creating a csv with the username(s) in only takes a second or two. I’ve just had a run through using Google sheets on my phone, and it was really quick. :+1:

6 Likes

Just highlighting this post, because it wasn’t very clear from the OP how to format the csv correctly.

3 Likes