Can I export Form Submissions?

2025/01/10 7:30 PM

Is there a way to export Form Submissions to either .csv or .xslx? I know we could do this in earlier versions of Kentico. I checked the roadmap but I didn't see anything mentioned there, so I was wondering if there is currently a way to do this, or if it's a planned feature.


Environment

Answers

2025/01/14 1:33 PM
Answer

Xperience by Kentico doesn't support this out-of-the-box yet. We will be working on feature updates to the Form Builder soon, so share your feedback with us to help us cover the scenarios you encounter.

That said, you can customize the Admin UI to export to CSV or XLSX.

Take a look at the Kentico Community Portal which has an example of this for newsletter recipient lists. It even has a generalized "data export" React component you can copy into your project to get you started.

2025/01/20 8:36 AM

@Sean, thanks for those links! We ended up doing something similar to newsletter recipients, but we have the data being sent in an email.

Out of curiosity, how do we wire up that React component? I can see that the PageCommandHandler returns return ResponseFrom(new { file = Convert.ToBase64String(ms.ToArray()) }); and that the React component handles that with const binaryString = atob(resp.file);. But I can't figure out

  1. How to include that React component in the project
  2. How to connect the two pieces. Is that just with the PageCommand EXPORT_LIST?
2025/01/25 12:06 AM

The way React component actions and backend Page endpoints are glued together is described in the documentation.

Using the [PageCommand] attribute you associate a command name with a public method on a Page class

[PageCommand(CommandName = "EXPORT_LIST")]
public async Task<ICommandResponse> PageCommandHandler(CancellationToken cancellationToken = default)
{
   // command behavior ...
}

From RecipientListOverviewExtender.cs

You call the command in your React code using the usePageCommand hook.

// Define how the hook operates
const { execute: dataExport } = usePageCommand<SubscriberExportResult>(
    'EXPORT_LIST', // Matches PageCommand attribute CommandName property
    {
      // configure the client-side behavior
    });

Then you call that hook to call the back-end command handler.

useEffect(() => {
    setState((s) => ({ ...s, status: 'EXPORTING' }));
    dataExport() // Calling my C# PageCommandHandler method
      .then(() => setState((s) => ({ ...s, status: 'COMPLETE' })))
      .catch((err) => {
        console.error(err);
        setState((s) => ({ ...s, status: 'FAILURE' }));
      });

From DataExportComponent.tsx

It might feel like there's less gluing these front and back-end components together than there should be, but what it enables is you can make a more generic React component and load it on any page in the administration.

As long as the back-end Page class has a command handler to handle the React component's commands and return a response in the shape the React component expects, you can mix and match Pages and React components.

To answer this question, you have to login first.