Identify the user that submitted a form
Version: 10.3
To find out who submitted a form, you can use the contact information associated with the form entry.
Before you begin
-
You must have the ability to query your Sitecore databases.
-
The Sitecore Experience Database (xDB) must be enabled in your solution.
The following SQL query retrieves form entry data, including the contact information, from all forms:
RequestResponse
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]
left outer join [<sitecoreInstancename>_Xdb.Collection.Shard0].[xdb_collection].[ContactFacets] cf0 on ci0.ContactId = cf0.ContactId and cf0.FacetKey = 'Personal'
left outer join