# User field searching / reporting

**URL:** https://meta.discourse.org/t/user-field-searching-reporting/244248
**Category:** Support
**Created:** [November 3, 2022, 10:11pm UTC](https://meta.discourse.org/t/user-field-searching-reporting/244248 "2022-11-03T22:11:03Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![SaraDev](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saradev/32/335139_2.png) [@SaraDev](https://meta.discourse.org/u/SaraDev)
#### Post date: [November 4, 2022, 12:33am UTC](https://meta.discourse.org/t/user-field-searching-reporting/244248/2 "2022-11-04T00:33:35Z")

</div>

> [@cogdog](#):
>
> I was really looking for some way of running a search or a query to generate a list of all users who have entered some value in this field (e.g. show me all users with a fediverse user name). Is this a custom query job? How would I do that?

This could be done with the [Data Explorer Plugin](https://meta.discourse.org/t/discourse-data-explorer/32566) using an SQL query like:

```sql
SELECT ucf.user_id,
       ucf.value,
       ucf.updated_at AS reltime$time
FROM user_custom_fields ucf
WHERE ucf.name = 'user_field_1'
AND ucf.value IS NOT NULL
ORDER BY ucf.updated_at DESC

```

Where `'user_field_1'` would be custom user field on your site you’re looking to view. Note that Discourse uses `user_field_1`, `user_field_2`, `user_field_3`, etc, as the names for the custom user fields within the `user_custom_fields` table rather than the text name of the fields on the Customize → User Fields page.

If you wanted, you could get a list of all the names of the custom user fields on your site and their corresponding `user_field` number with:

```sql
SELECT uf.id, uf.name
FROM user_fields uf

```

Where the ID of the user\_field would be the `user_field_X` name within the `user_custom_fields` table.

With that in mind, I’m not sure why you wouldn’t be able to search your user fields in the search window as long as the user field is searchable.

You might try using the advanced search menu and selecting “Users” as the place to search and see if you’re getting the same results:

 ![image](https://global.discourse-cdn.com/meta/original/4X/9/6/3/96396feec1a0708cb12be0d53eff3f90fc7b20c5.png)

---

_[View the full topic](https://meta.discourse.org/t/user-field-searching-reporting/244248)._
