I have 4 webforms on a site and I would like to be able to display the data from each of those in a table using a view. Each of the forms has a "First Name" "Last Name" "Phone Number" and "Email Address" field, along with other fields that are specific to the different forms. Ideally, I would like to have a table that shows those 4 fields from all of the forms along with a column that says what form it came from. Can anyone give me an idea of where to start? My assumption is that the answer is somewhere in relationships and contextual filters, but I'm still learning how all of that stuff works. Any help or advice would be greatly appreciated. Thanks!!
Well after a couple of weeks I got it to work. In case anyone else wants to do the same, here is how I did it.
I added a Webform submissions: Data Relationship for each field in each form (16 total for me....4 fields from 4 webforms). Then I added the fields for each one (again 16 total). Then I went into the Table Settings and had each of the 4 types displayed in the same column. Then I just added a Content: Title field to show which Webform the submission came from.
I don't know if that is the best way to do it, but it worked for me.
Just stack into this and found one more solution:
- Create the view to show webform submissions
- Set its output format to Rendered Submissions | HTML
Ok, now we have all data from webform, but it looks not so good.
Create in your administration theme file webform-submission.tpl.php and theme it!
In my case it looks like this:
<?php print 'Form name: '.$node->title.' <p><b>'.date('d.m.Y h:i', $submission->submitted).'</b></p>'; print drupal_render_children($renderable); ?>
You can output more data from $node, $submission and $renderable variables.