Score:-1

How can I programmatically download webform results?

cn flag

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?

cn flag
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.
cn flag
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 :)
Pierre.Vriens avatar
gb flag
Is this about D5 or D6, possibly even a more recent Drupal release ???
Score:2
cn flag

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.

cn flag
Thank you for the response. Will try the drush option and see how it goes.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.