Hi.
I've searched before posting...

I have a quite large webform with about 30 optional fields with numbers. When browsing individual submissions, fields that were not filled and thus remain blank or with default value (0 in my case) are not important for me.

I'd like to only see fields with relevant (non-zero) values and hide the rest - or sort the fields by their values so the fields with 0 would be at the bottom. Otherwise it's very easy to overlook non-zero value in the webform when evaluating it. Is there a way to do this?

I tried to install webform_reports module but failed to produce the desired effect with it.
Thank you.

Comments

charmer’s picture

Ok, so I learned that I need to use webform Additional Processing to filter the results. However I still have a small issue. I have small testing form that looks like this when dumped:

array(7) { ["submitted"]=> array(3) { [1]=> string(3) "555" [2]=> string(1) "0" [3]=> string(1) "0" } ["details"]=> array(4) { ["email_subject"]=> string(1) "1" ["email_from_name"]=> string(1) "1" ["email_from_address"]=> string(7) "default" ["nid"]=> string(1) "4" } ["op"]=> string(6) "Submit" ["submit"]=> string(6) "Submit" ["form_token"]=> string(32) "27317820a3d3082a8cdfb2e7b6c2c998" ["form_id"]=> string(21) "webform_client_form_4" ["submitted_tree"]=> array(3) { ["otazka_1"]=> string(3) "555" ["otazka_2"]=> string(1) "0" ["otazka_3"]=> string(1) "0" } }

i.e. three form fields with values "555", "0", "0".

The following piece of code is supposed to filter out fields with value of "0":

<?php
# var_dump($form_values);
foreach($form_values['submitted'] as $key=>$val) {
   if ($val == "0") {
     unset($form_values['submitted'][$key]);
   }
}
# var_dump($form_values);
?>

var_dump looks good, zero values are filtered out, but form submission still contains all fields. I tried to replace submitted with submitted_tree but still to no avail.

Can anyone please help me to nail down this thing? Thanks in advance.

k3vin’s picture

charmer, as i know there isn't a possiblity to hide blank fields in results e-mail notifications. I have the same problem too and I think this is a new feature request.

brnnrc’s picture

subscribe

mattcasey’s picture

subscribe!

quicksketch’s picture

Status: Active » Fixed

This has already been answered at #347361: empty fields not to be included in e-mail.

mattcasey’s picture

thanks quicksketch, i appreciate your regularly prompt support with this module!

Status: Fixed » Closed (fixed)

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