0
votes

I have webform module in drupal 7.23.I have 4 fields in name,email,message and publish fields.publish field is displayed only for admin user and not displayed for anonymous user. publish field is a select option.This webform field is not available in filter criteria. I want to save the content as draft and display only after admin review ie) have to add filter criteria for publish field in view.

Now I want to publish filter is not available for filter criteria.

I want to display the content if publish field value is 1

1

1 Answers

0
votes

Let me share my findings, it works for me according to your requirement.

Webforms' Select List won't work with views expose filter as it works with content type/taxonomy. See comment by webform contributor here

To achieve that follow these steps:

1st step I created a new component in the webform named as published? with the type Select options and set its default value as "no" (because it won't show to other user it'll be empty so they can't set an value the you can't filter submissions) and check the Private check box like this

enter image description here

2nd step Create a views page for webform submissions like this

enter image description here

3rd step Add relations using Webform submissions: Data and set up like this

enter image description here

4th step Add filter criteria using Webform submission data: Data field field, expose it, choose Grouped filters radio option, select widget type as select and set relationship and don't save it yet

5th step For the group filter, there is table below (scrrenshort) you can add your values like you add value while creating the Publish component in webform.

enter image description here

I hope this'd work for you. Thank