1. Reporting

Identify the user that submitted a form

Version:

To find out who submitted a form, you can use the contact information associated with the form entry.

Before you begin

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

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];
If you have suggestions for improving this article, let us know!