There is a lot of info available (also outside of d.o) on how to get submission data exported (some of the most clear/authoritative ones are related issues.) A lot of it is for different versions of webform though it seems. From what I gather it is even possible using filters on specific submitted data fields (or webform components actually). Unfortunately I haven't been able to get it working, nor is there a handbook page for it (which I am willing to create and make screenshots for btw) but this might certainly clear up a lot of confusion.

I basically just want to export certain submissions based on a filter (as select) which can be set by an user.

I have tried many routes towards this. Webform report, which goes a long way but the report filters aren't editable by the user. So then I tried using views (problably with views data export or VBO to do actual exporting) and I tried the "webform mysql views / data" way which didn't quite work out.

So my latest steps using purely webform :

  1. updating to webform 4.2 (or later) because of the views (integration) it provides
  2. clone the 'Webform Submission' view
  3. add the webform submission data: value as a views field to display. This works fine. The values show up in the table, just as they do in webform or the default webform page.
  4. as explained in the related topics to be abe to use submission data as filters you first have to add a relationship to it. So I did relationship -> add -> webform submission: data -> select the node the webform is attached to -> -> select the field I am interested in.
  5. Add a filter webform submmission data : data -> use the relation just created -> check 'expose' -> leave operator on 'equals' .
  6. What I notice here is that for the value there is a textfield. Not a select list, nor checkboxes with the possible values for the select list.

After these steps I do see an exposed filter for the submission data/component. But it is a textfield and not a select list. Although the component used for the data is a select. Furthermore it doesn't work when searching for the values of the select, which ARE displayed correctly in the tabel beneath it. It just works when searching/filtering for the keys of the select, which isn't really useful as the end user does not know which these are. See screenshots.

So now I am a bit lost. What am I doing wrong? Or isn't it even possible what I am attempting here?
Would it be good idea to create a handbook page for this?

CommentFileSizeAuthor
filter key.png19.4 KBfirfin
value filter.png12.14 KBfirfin
no filter.png20.45 KBfirfin
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DanChadwick’s picture

Status: Active » Fixed

You're not missing anything. This is the currently level of support for exposed filters on submission values.

More could be implemented, but it would be a fairly big job. Each component type would need a different exposed filter. You could implement this for the built-in webform component types, and then fall back to a textfield if the component type doesn't implement the exposed filter.

Or you could custom-code your own exposed filter and pass the filter value via the URL to the view.

tl;dr: select-type exposed filters aren't implement.

Patches or sponsorship welcome.

firfin’s picture

Thank you for explaining Dan. That is indeed a fairly ( I would say really) big job,now that I understand what needs to be done. Secretly I was still hoping for the config option I overlooked. ;-)

Unfortunately I am already over budget for the project I need this for, so I think I am going for a quick fix (multiple webform reports).

But I might pick this up later when time allows. What would be the best way to tackle this you think?
Creating include files for every component type / exposed filter? Like webform_handler_filter_filtername.inc ?
Is this functionality on the roadmap somewhere already by the way / something I could take a look at?

DanChadwick’s picture

I don't really know what the architecture would have to be. Part would be to extend each component with another hook that creates the exposed filter. The harder part would be to integrate that into views.

Heba Jaber’s picture

Priority: Normal » Major
Status: Fixed » Needs work

Is there any solution till now?

I need an exposed filter for webform submission to be a select list rather than text field, when it is a select list field in the webform originally.

DanChadwick’s picture

Priority: Major » Normal
Status: Needs work » Fixed

No, this feature is not currently available without custom programming.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

yaach’s picture

Any updates on this?

yaach’s picture

Status: Closed (fixed) » Needs review
DanChadwick’s picture

Status: Needs review » Closed (fixed)

Please read the issue queue status guidelines. There is nothing to review. The issue is closed/fixed because there is no further commentary. This isn't a feature and isn't planned to be. If someone wants to write a patch, by all means feel to re-open.

joshuautley’s picture

View must be a Page. Instructions > https://www.drupal.org/node/2453023