-1

I want to download the results of certain webforms. I currently download them as CSV file by navigating to the download tab within the Drupal UI.

Is it possible to programmatically download the results?

3
  • 1
    How many webforms and how often? It's possible to set up something automated for this, but you could also just bookmark a group of tabs in Chrome and quickly click through that, which takes about 1 minute to set up. Also, how do you want them to be automated? Automatic export to files? A single link to download all the files? It's not clear exactly what you want to do. Commented Aug 12, 2021 at 6:06
  • I have 12 forms I download results for periodically (i.e Monthy). I'd like to automate the process so all 12 form results are downloaded in csv file or files , rather than downloading each one by one. Hope what I'm trying to do is clear now :)
    – winston
    Commented Aug 12, 2021 at 10:14
  • Is this about D5 or D6, possibly even a more recent Drupal release ??? Commented Aug 12, 2021 at 10:54

1 Answer 1

2

The most easiest way to do it programmatically is via the commandline with drush:

drush webform:export contact_webform_name --destination=/var/test.csv

If you want to do it throug PHP you can use the WebformCommand directly. https://git.drupalcode.org/project/webform/-/blob/8.x-5.x/src/Commands/WebformCliService.php and look for the drush_webform_export function.

1
  • Thank you for the response. Will try the drush option and see how it goes.
    – winston
    Commented Aug 27, 2021 at 4:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.