# How to query a confirmation-type custom user field?

**URL:** <https://meta.discourse.org/t/how-to-query-a-confirmation-type-custom-user-field/68397>\
**Category:** Support\
**Created:** [19 Agosto 2017, 11:12pm UTC](https://meta.discourse.org/t/how-to-query-a-confirmation-type-custom-user-field/68397 "2017-08-19T23:12:11Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)\
**Post date:** [19 Agosto 2017, 11:12pm UTC](https://meta.discourse.org/t/how-to-query-a-confirmation-type-custom-user-field/68397/1 "2017-08-19T23:12:11Z")

</div>

I’m trying get a list of all users that do _not_ have ticked a specific custom user field. I managed to get a list of those who _have_ ticked it, but I can’t seem to do the inverse:

```plaintext
SELECT cf.user_id
FROM user_custom_fields cf
WHERE cf.name like 'user_field_5' AND
cf.value = 'true'

```

For example, `cf.value = 'false'` gives me an empty list, and so does `cf.value = ''` and also `cf.value = 'null'`.

BTW, I found it confusing that the datatype of a confirmation type user field is not boolean but text. I figure it’s to keep the user field table simple with just one data type?

---

_[View the full topic](https://meta.discourse.org/t/how-to-query-a-confirmation-type-custom-user-field/68397)._
