# Using Data Explorer to take action if an admin reads a user private message

**URL:** <https://meta.discourse.org/t/using-data-explorer-to-take-action-if-an-admin-reads-a-user-private-message/154119>\
**Category:** Data & reporting\
**Tags:** sql-query\
**Created:** [June 7, 2020, 7:10pm UTC](https://meta.discourse.org/t/using-data-explorer-to-take-action-if-an-admin-reads-a-user-private-message/154119 "2020-06-07T19:10:42Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [June 7, 2020, 7:23pm UTC](https://meta.discourse.org/t/using-data-explorer-to-take-action-if-an-admin-reads-a-user-private-message/154119/2 "2020-06-07T19:23:47Z")

</div>

> [@sunjam](#):
>
> I’m curious about a [data explorer](https://meta.discourse.org/t/32566?silent=true) custom action for notifying all `@staff` or `@admin` group every time one of them reads the contents of a user private message

I think that what you are looking for would be to have an entry added to the staff action logs (found on your Admin / Logs / Staff Actions page) if the results of a [Data Explorer](https://meta.discourse.org/t/32566?silent=true) query show a user’s personal message.

If a staff member views a user’s email address through the UI, an entry is added to the staff action logs. If the `log personal messages views` site setting is enabled and an admin views a PM through the Discourse UI, an entry is added to the staff action logs. If the same data is viewed by running a [Data Explorer](https://meta.discourse.org/t/32566?silent=true) query, no entry is added to the staff action logs. I’m not sure if there’s a good solution for this, but it’s something I’ve wondered about in the past.

---

_[View the full topic](https://meta.discourse.org/t/using-data-explorer-to-take-action-if-an-admin-reads-a-user-private-message/154119)._
