Get the views field value How to get the views field value and make a condition base on that field. Let say may views field is 'field_state'

Example below: 

function my_module_views_pre_render(ViewExecutable $view) {
  //current user id
  $user_id = \Drupal::currentUser()-&gt;id();
  //load user data
  $user = \Drupal\user\Entity\User::load($user_id);
   // Get user state
  $state = $user-&gt;get('field_state')-&gt;getValue()[0]['value'];  
  if ($state == Views field_state value) {
        $view-&gt;field['field_state']-&gt;options['exclude'] = TRUE; // exclude field for only this result ???
  }
  else{
    $view-&gt;field['field_state']-&gt;options['exclude'] = FALSE; // include field for only this result ??? 
  }
}


Is it possible on views pre-render or I need to use the different hook?
You should try hook_views_post_build(). I haven't tried this but I was looking at the views api and noticed that hook_views_post_build shows an example of modifying the exclude property of a field.