# Trying to query to find user custom fields filled out

**URL:** <https://meta.discourse.org/t/trying-to-query-to-find-user-custom-fields-filled-out/86472>\
**Category:** Data & reporting\
**Tags:** sql-query, user-custom-fields\
**Created:** [April 30, 2018, 6:42pm UTC](https://meta.discourse.org/t/trying-to-query-to-find-user-custom-fields-filled-out/86472 "2018-04-30T18:42:26Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jerdog](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jerdog/32/122843_2.png) [@jerdog](https://meta.discourse.org/u/jerdog)\
**Post date:** [April 30, 2018, 6:42pm UTC](https://meta.discourse.org/t/trying-to-query-to-find-user-custom-fields-filled-out/86472/1 "2018-04-30T18:42:26Z")

</div>

I have a [data explorer](https://meta.discourse.org/t/32566?silent=true) query where I am trying to find all who have filled out `user custom field` 1-4, and would love it to only show those with all 4 as columns for each user, but my postgre skills are _limited_ and I haven’t been able to figure it out:

```
SELECT user_id, name, value
FROM user_custom_fields
WHERE name IN ('user_field_1','user_field_2','user_field_3','user_field_4')
    AND value IS NOT NULL
ORDER BY user_id ASC, name ASC

```

---

_[View the full topic](https://meta.discourse.org/t/trying-to-query-to-find-user-custom-fields-filled-out/86472)._
