How to create a list of users who did not submit some webform? I have a webform expecting all users to record their data online.

I would like to list all users who did not submit the webform yet.
I have been trying to use Views, but I cannot find a way to do that.

To list users who have submitted is not a problem, just display the users submitting in Views table.

How can I list all users who did not submit the webform?
Step 1 - Introduce a webform submission flag

Install/enable the Flag module.
Navigate to /admin/structure/flags/add/node and create a flag (do not check the "global" checkbox). Let's assume you label it something like "Webform submission". For "Bundles" (on the same form), check "Webform".

Here is such Flag definition (in export format) you could use for it (just import it in your own site):

$flags = array();
// Exported flag: "Webform submission".
$flags['webform_submission'] = array (
  'entity_type' =&gt; 'node',
  'title' =&gt; 'Webform submission',
  'global' =&gt; '0',
  'types' =&gt; 
  array (
    0 =&gt; 'webform',
  ),
  'flag_short' =&gt; 'Webform submitted',
  'flag_long' =&gt; 'Indication that the Webform was submitted already',
  'flag_message' =&gt; 'Webform submission recorded',
  'unflag_short' =&gt; 'Webform NOT submitted',
  'unflag_long' =&gt; 'Indication that the Webform is not yet submitted',
  'unflag_message' =&gt; 'Webform submission recording removed',
  'unflag_denied_text' =&gt; '',
  'link_type' =&gt; 'toggle',
  'weight' =&gt; 0,
  'show_in_links' =&gt; 
  array (
    'full' =&gt; 0,
    'teaser' =&gt; 0,
    'rss' =&gt; 0,
    'search_index' =&gt; 0,
    'search_result' =&gt; 0,
    'answers_full_node' =&gt; 0,
    'print' =&gt; 0,
  ),
  'show_as_field' =&gt; 0,
  'show_on_form' =&gt; 0,
  'access_author' =&gt; '',
  'show_contextual_link' =&gt; 0,
  'i18n' =&gt; 0,
  'api_version' =&gt; 3,
);
return $flags;


Step 2 - Register webform submissions

Install/enable the Rules module and create a Rule to flag the webform when it is submitted (by the user who submitted the webform and using the flag "Webform submission" (from Step 1).

Here is such Rule definition (in export format) you could use for it (just import it in your own site, which you can do if you have the 'Rules UI' enabled):

{ "rules_flag_a_submitted_webform" : {
    "LABEL" : "Flag a submitted webform",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules", "flag", "webform_rules" ],
    "ON" : { "webform_rules_submit" : [] },
    "IF" : [
      { "data_is" : { "data" : [ "node:nid" ], "value" : "5" } },
      { "user_has_role" : { "account" : [ "user" ], "roles" : { "value" : { "2" : "2" } } } }
    ],
    "DO" : [
      { "flag_flagnode" : {
          "flag" : "webform_submission",
          "node" : [ "node" ],
          "flagging_user" : [ "user" ],
          "permission_check" : "1"
        }
      }
    ]
  }
}


Step 3 - List the webform submissions

Create a view (using the Views module), to list the user who have yes or no flagged the webform with the "Webform submission"-flag from Step 1).

Here is such Views definition (in export format) you could use for it (just import it in your own site, which you can do if you have the 'Views UI' enabled):

$view = new view();
$view-&gt;name = 'webform_submissions_by_users';
$view-&gt;description = '';
$view-&gt;tag = 'default';
$view-&gt;base_table = 'users';
$view-&gt;human_name = 'Webform submissions by users';
$view-&gt;core = 7;
$view-&gt;api_version = '3.0';
$view-&gt;disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view-&gt;new_display('default', 'Master', 'default');
$handler-&gt;display-&gt;display_options['title'] = 'Webform submissions by users';
$handler-&gt;display-&gt;display_options['use_more_always'] = FALSE;
$handler-&gt;display-&gt;display_options['access']['type'] = 'perm';
$handler-&gt;display-&gt;display_options['access']['perm'] = 'access user profiles';
$handler-&gt;display-&gt;display_options['cache']['type'] = 'none';
$handler-&gt;display-&gt;display_options['query']['type'] = 'views_query';
$handler-&gt;display-&gt;display_options['exposed_form']['type'] = 'basic';
$handler-&gt;display-&gt;display_options['pager']['type'] = 'full';
$handler-&gt;display-&gt;display_options['pager']['options']['items_per_page'] = '10';
$handler-&gt;display-&gt;display_options['style_plugin'] = 'table';
/* Relationship: Flags: User's flaggings */
$handler-&gt;display-&gt;display_options['relationships']['flag_user_content_rel']['id'] = 'flag_user_content_rel';
$handler-&gt;display-&gt;display_options['relationships']['flag_user_content_rel']['table'] = 'users';
$handler-&gt;display-&gt;display_options['relationships']['flag_user_content_rel']['field'] = 'flag_user_content_rel';
$handler-&gt;display-&gt;display_options['relationships']['flag_user_content_rel']['required'] = 0;
$handler-&gt;display-&gt;display_options['relationships']['flag_user_content_rel']['flag'] = 'webform_submission';
/* Field: User: Name */
$handler-&gt;display-&gt;display_options['fields']['name']['id'] = 'name';
$handler-&gt;display-&gt;display_options['fields']['name']['table'] = 'users';
$handler-&gt;display-&gt;display_options['fields']['name']['field'] = 'name';
$handler-&gt;display-&gt;display_options['fields']['name']['alter']['word_boundary'] = FALSE;
$handler-&gt;display-&gt;display_options['fields']['name']['alter']['ellipsis'] = FALSE;
/* Field: Flags: User uid */
$handler-&gt;display-&gt;display_options['fields']['uid']['id'] = 'uid';
$handler-&gt;display-&gt;display_options['fields']['uid']['table'] = 'flagging';
$handler-&gt;display-&gt;display_options['fields']['uid']['field'] = 'uid';
$handler-&gt;display-&gt;display_options['fields']['uid']['relationship'] = 'flag_user_content_rel';
/* Field: Flags: Flagged time */
$handler-&gt;display-&gt;display_options['fields']['timestamp']['id'] = 'timestamp';
$handler-&gt;display-&gt;display_options['fields']['timestamp']['table'] = 'flagging';
$handler-&gt;display-&gt;display_options['fields']['timestamp']['field'] = 'timestamp';
$handler-&gt;display-&gt;display_options['fields']['timestamp']['relationship'] = 'flag_user_content_rel';
$handler-&gt;display-&gt;display_options['fields']['timestamp']['date_format'] = 'long';
$handler-&gt;display-&gt;display_options['fields']['timestamp']['second_date_format'] = 'long';
/* Sort criterion: User: Uid */
$handler-&gt;display-&gt;display_options['sorts']['uid']['id'] = 'uid';
$handler-&gt;display-&gt;display_options['sorts']['uid']['table'] = 'users';
$handler-&gt;display-&gt;display_options['sorts']['uid']['field'] = 'uid';
/* Filter criterion: Flags: User uid */
$handler-&gt;display-&gt;display_options['filters']['uid']['id'] = 'uid';
$handler-&gt;display-&gt;display_options['filters']['uid']['table'] = 'flagging';
$handler-&gt;display-&gt;display_options['filters']['uid']['field'] = 'uid';
$handler-&gt;display-&gt;display_options['filters']['uid']['relationship'] = 'flag_user_content_rel';
$handler-&gt;display-&gt;display_options['filters']['uid']['value'] = '';
$handler-&gt;display-&gt;display_options['filters']['uid']['exposed'] = TRUE;
$handler-&gt;display-&gt;display_options['filters']['uid']['expose']['operator_id'] = 'uid_op';
$handler-&gt;display-&gt;display_options['filters']['uid']['expose']['label'] = 'User uid';
$handler-&gt;display-&gt;display_options['filters']['uid']['expose']['use_operator'] = TRUE;
$handler-&gt;display-&gt;display_options['filters']['uid']['expose']['operator'] = 'uid_op';
$handler-&gt;display-&gt;display_options['filters']['uid']['expose']['identifier'] = 'uid';
$handler-&gt;display-&gt;display_options['filters']['uid']['expose']['remember_roles'] = array(
  2 =&gt; '2',
  1 =&gt; 0,
  3 =&gt; 0,
  4 =&gt; 0,
  5 =&gt; 0,
  6 =&gt; 0,
);
/* Filter criterion: User: Active */
$handler-&gt;display-&gt;display_options['filters']['status']['id'] = 'status';
$handler-&gt;display-&gt;display_options['filters']['status']['table'] = 'users';
$handler-&gt;display-&gt;display_options['filters']['status']['field'] = 'status';
$handler-&gt;display-&gt;display_options['filters']['status']['value'] = '1';

/* Display: Page */
$handler = $view-&gt;new_display('page', 'Page', 'page');
$handler-&gt;display-&gt;display_options['path'] = 'webform-submissions-by-users';


Fruit of your labor

If you import the above definitions of the flag, the rule and the view, and you have a few users submit the webform (= record their data), you can visit the relative path in your own site, which should then display a table that looks similar to this example:

Name            User uid   Flagged time
--------------+----------+--------------------------------
Demo.User     !          !                                
Famous.Dries  ! 8        ! Wednesday, May 11, 2016 - 19:13
Pierre.Vriens ! 19       ! Wednesday, May 11, 2016 - 18:07 


For the above example, user "Demo.User" had not yet submitted the webform. The view contains an exposed filter so that you can limit the display to only those who submitted the form, or those who did not yet submit the form.

Start nagging users

If you would enhance your view from Step 3 with the Views Bulk Operations module, and you'd create a Rules Component (using the Rules module) to send an eMail, you could use it to eMail all those users in that view with some type of nagging eMail like "Please record your data...".

What's next?

The above doesn't take into account any webform submissions from before the above logic is implement. However it should be pretty forward to use a mixture of the above (4) modules, including VBO, to perform such one time only update (to also flag the users who already submitted the webform in the past). Anybody interested in knowing about that: Ask (a followup) Question ...