Problem/Motivation

We have some webforms used for recording interviews and we need to export the submissions results from all webforms in one csv file.

  1. We have tried to use the webform_views and views_data_export modules. We have been able to create a view combining all the results, exactly as needed. When creating a 'Page' display, we have a 'Webform Submission' option in the 'Format' section, as per the screenshot attached. When we attempt to create a 'Data Export' display, this option is unavailable. There is an 'Entity' option, but this does not have the webform fields, only some general things such as IP, etc.
  2. We have also looked at extending the WebformSubmissionExporter.php class to pass through the submissions we require. We found it challenging to make this work with more than one webform.
CommentFileSizeAuthor
Screen Shot 2019-05-17 at 4.12.26 pm.png129.04 KBlaurab

Comments

laurab created an issue. See original summary.

jrockowitz’s picture

Status: Active » Closed (won't fix)

There is no way to merge different webform export via a UI. You have to write custom code.

I would start by looking at the WebformResultsExportController::index and work to chain together the export of multiple webform submissions.

Don't forget there is also a drush webform-export command.
@see \Drupal\webform\Commands\WebformCliService::drush_webform_export

ewaters5’s picture

@jrockowitz do you know of a way to merge the submission data of fields from multiple webforms in a single view? For example, 3 webforms each with fields name, date, topic. I want a single view to pull submission data from all 3 forms and display these 3 fields sorted by submission date. Is this possible?

jrockowitz’s picture

You might be able to build a custom CSV using https://www.drupal.org/project/webform_query

imclean’s picture

@ewaters5, if the field names in each of the forms are exactly the same this can be done with Webform views. When you create the view, filter by the form IDs and add only the first form's fields. Submissions from the other forms should also appear.

For example, title: "Your name", category: "Webform Form Number 1".

andrew robinson’s picture

@laurab Would you mind outlining the solution you settled upon with for achieving this?