Be able to manually change badge status to “not grantable”

I have loads of badges on my site which are automatically granted via the API when someone does something on the connected WordPress site. It works great!

However I have a few badges I need to manually grant on posts.

When I do this, allllll the badges I have set up appear in the “grantable badges” list which means lots of scrolling.

Is there a way to set a badge as being “not grantable” by admins, but keep it possible to grant via the API? That would help with management of badges.

Thanks!

1 Like

I noticed that badges with SQL logic don’t appear in the list to grant, so is there a way for me to add some fake / impossible SQL logic to a badge so that it doesn’t appear in the list, but I can still grant with the API?

Have you enabled the custom badge SQL from the hidden setting? Enable Badge SQL

I have yes

If you have the box to add some SQL then I think you can try to add some impossible-to-get criteria in there and see how you get on. :+1: It’s not really what it’s intended for, but it might work out for what you need.

Maybe something like:

SELECT id user_id, created_at granted_at
FROM users
WHERE id = -1000

Make sure auto-revoke isn’t set as well, as that would strip the manually granted ones too.

I got this error:

Query triggers on users, but does not reference the ':user_ids' array

Did you pick a real user-based trigger? I left mine blank. I think ‘Update Daily’ would also work.

Ah yes, updated daily works fine, thanks. I’ll check it see if I can still grant it with the API.

Yes that all worked fine, thanks! As long as there is no downside to this fake SQL, it should be the solution I was looking for!

1 Like