David Lohmeyer's Blog

Using Drupal Webform submission data

The Webform Drupal module is an amazing thing.  It lets you build all sorts of amazing forms.  Combined with jQuery you can construct dynamic forms that improve user quality of life.  However, Webform's export features are extremely limited.  You can get a run-of-the-mill exported CSV with every component includes with the generic field name.  What if you want or require a different format or a variable number of submissions only?  It seems like the only real solution right now is to write your own app or module that reads Webform's data.

I found a a new module called Webform MySQL Views that helps target data from Webform submissions.  This should help anyone writing something to interact with Webform submission data.

I recently wrote a backend PHP application that reads Webform data and exports it into a completely customized CSV.  It is pretty generic, though it requires manual setting updates to change what you're exporting into CSV (it needs component ID's from the targeted Webform).  The purpose of this customized CSV exporter is to import into The Raiser's Edge, a proprietary CRM that nonprofits use to track constituents.  Why not a module?  I definitely tried to make a module out of this, though having not authored a Drupal module yet my experience is somewhat limited in the Drupal API and it was more efficient to make an external app.  I learned a lot about module development though, so this could be a future endeavor (or maybe the Webform maintainers will expand on their export functionality).  Jumping straight into the Webform code and trying to understand all of it as a relative newcomer to module development isn't something I would recommend for everyone.

Related Posts