I'm using Sitecore 9.0.1 and using the default Save Data submit action on my form:
There are many garbage entries due to test and bot submissions, and there isn't a way to delete any of the entries.
Sitecore 9.3 appears to offer deletion functionality, although it is limited; only supporting deletion of all entries and entries for a specified date range.
We have been using Sitecore PowerShell Extensions to allow users to view the form entries within Sitecore itself, thanks to these Forms Data Viewer SPE scripts. The scripts ultimately leverage the Show-ListView SPE function to display and export the data like so:
Now I just need to make the final leap and allow individual entries to be deleted. Any ideas about how I can approach this? It's not clear to me because the data listed in the table doesn't correspond to items, so it's not as simple as doing a simple delete via SPE.
I've done some digging to see what Sitecore.Experience.Forms.Data
provides in terms of functionality. Here's a decompilation:
using Sitecore.ExperienceForms.Data.Entities;
using System;
using System.Collections.Generic;
namespace Sitecore.ExperienceForms.Data
{
public interface IFormDataProvider
{
void CreateEntry(FormEntry entry);
void DeleteEntries(Guid formId);
IReadOnlyCollection<FormEntry> GetEntries(Guid formId, DateTime? startDate, DateTime? endDate);
}
}
Unfortunately it doesn't look like it provides an interface for deleting specific entries. It's all or nothing (at least on Sitecore version 9.0.1.). The question now becomes how can I see what's in DeleteEntries
and how can I extend the IFormDataProvider
to add the necessary functionality? From there I should be able to write the necessary PowerShell script for the list view action.
Another option seems to be to run SQL directly on the form entry table. Then it becomes a question of how to plug and play that with SPE via a custom action within the list view.