how to use tokens as “views filter criteria” for a custom table? I created view for fields from a custom table using handlers.
I need to create a filter so that only the users who created the data can see the data.
how can I create the filter?
We do not have token based filters, but instead what we can use is 'contextual filters', with in contextual filters you can get current logged in user.

I am assuming you are storing user information(mostly uid) to know who created what.

Now since its a custom table, the relation/join for users table with your custom table you have to define while exposing it to views. Here goes the sample code.

/**
 * Implements hook_views_data().
 */
function dev_test_views_data() {

  $data = array();

  $data['custom_view_expose']['table']['group'] = t('Custom table exposed');

  $data['custom_view_expose']['table']['base'] = array(
    'title' =&gt; t('custom table exposed'),
    'help' =&gt; t('Contains records we want exposed to Views.'),
  );
  $data['custom_view_expose']['record_id'] = array(
    'title' =&gt; t('Record ID'),
    'help' =&gt; t('The record ID.'),
    'field' =&gt; array(
      'handler' =&gt; 'views_handler_field_numeric',
    ),
    'sort' =&gt; array(
      'handler' =&gt; 'views_handler_sort',
    ),
    'filter' =&gt; array(
      'handler' =&gt; 'views_handler_filter_numeric',
    ),
  );
  $data['custom_view_expose']['data'] = array(
    'title' =&gt; t('Data'),
    'help' =&gt; t('The Data.'),
    'field' =&gt; array(
      'handler' =&gt; 'views_handler_field',
    ),
    'sort' =&gt; array(
      'handler' =&gt; 'views_handler_sort',
    ),
    'filter' =&gt; array(
      'handler' =&gt; 'views_handler_filter_string',
    ),
  );
  // Allow views to join it with users table if needed while querying database.
  $data['custom_view_expose']['table']['join'] = array(
    'users' =&gt; array(
      'left_field' =&gt; 'uid',
      'field' =&gt; 'uid',
    ),
  );

  $data['custom_view_expose']['uid'] = array(
    'title' =&gt; t('User ID'),
    'help' =&gt; t('The record user ID.'),
    'field' =&gt; array(
      'handler' =&gt; 'views_handler_field_user',
    ),
    'sort' =&gt; array(
      'handler' =&gt; 'views_handler_sort',
    ),
    'filter' =&gt; array(
      'handler' =&gt; 'views_handler_filter_numeric',
    ),
    // Allow this field to show in relationship option.
    'relationship' =&gt; array(
      'base' =&gt; 'users',
      'field' =&gt; 'uid',
      'handler' =&gt; 'views_handler_relationship',
      'label' =&gt; t('Users'),
    ),
    // Get this field as contextual filter option.
    'argument' =&gt; array(
      'handler' =&gt; 'views_handler_argument_user_uid',
      'numeric' =&gt; TRUE,
      'validate type' =&gt; 'uid',
    ),
  );

  return $data;
}


The above code exposes a very simple table as in screenshot



Now while creating the views within your contextual filter options will see uid as on the fields for which you can pick value to come from current logged in user, and views will automatically filter down results. Adding views screenshot

.