Skip to content

Instantly share code, notes, and snippets.

@tackme31
Last active December 14, 2020 05:51
Show Gist options
  • Save tackme31/04d8b8b7a75c63c3955b0d326114c26c to your computer and use it in GitHub Desktop.
Save tackme31/04d8b8b7a75c63c3955b0d326114c26c to your computer and use it in GitHub Desktop.
A Sitecore PowerShell Extensions script for displaying data of Sitecore Forms without exporting.
<#
You can use this script as reporting tool by using Forms Data Viewer
- [Forms Data Viewer - Sitecore Marketplace](https://marketplace.sitecore.net/Modules/F/Forms_Data_Viewer.aspx)
#>
$result = Read-Variable -Parameters `
@{Name='formItem'; Title='Form'; Editor='droptree'; Source="DataSource=/sitecore/Forms"},
@{Name='startDate'; Title='Start date'; Editor='date'},
@{Name='endDate'; Title='End date'; Editor='date'}
if ($result -ne "ok") {
exit
}
$provider = [Sitecore.DependencyInjection.ServiceLocator]::ServiceProvider.GetService([Sitecore.ExperienceForms.Data.IExportDataProvider])
$provider.Export($formItem.ID.Guid, $startDate, $endDate).Content `
| ConvertFrom-Csv -Delimiter ';' `
| Show-ListView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment