---
title: "Identify the user that submitted a form"
slug: "identify-the-user-that-submitted-a-form"
abstract: "Provides a SQL query to identify the user that submitted a form."
---
# Identify the user that submitted a form

To find out who submitted a form, you can use the [contact](https://doc.sitecore.com/xp/en/developers/100/sitecore-experience-platform/contacts.html) information associated with the form entry.

> [!note]
> **Before you begin**
> -   You must have the ability to query your Sitecore databases.
>
> -   The [Sitecore Experience Database (xDB) must be enabled](https://doc.sitecore.com/xp/en/developers/100/platform-administration-and-architecture/enable-disable-the-xdb-and-the-tracker.html) in your solution.

The following SQL query retrieves form entry data, including the contact information, from all forms:

```sql
select fe.FormDefinitionId,
       mi.Name as [FormName],
       fe.Created,
       case when ci1.contactId is null then ci0.contactId else ci1.contactId end as [ContactId],
       fd.FieldName,
       fd.[Value]
from [<sitecoreInstancename>_ExperienceForms].[sitecore_forms_storage].[FormEntries] fe
inner join [<sitecoreInstancename>_ExperienceForms].[sitecore_forms_storage].[FieldData] fd
        on fe.Id = fd.FormEntryId
inner join [<sitecoreInstancename>_Master].dbo.Items mi
        on fe.FormDefinitionId = mi.ID
left outer join [<sitecoreInstancename>_Xdb.Collection.Shard0].[xdb_collection].[ContactIdentifiers] ci0
        on replace(fe.contactid,'-','') = ci0.[Identifier]
left outer join [<sitecoreInstancename>_Xdb.Collection.Shard1].[xdb_collection].[ContactIdentifiers] ci1
        on replace(fe.contactid,'-','') = ci1.[Identifier];

```