28 May 2021
Select Query to get users of empty fields
Published On: Fri, 05/28/2021 - 23:30
Select those users which name (Custom field) is empty
In the following I have created a custom field (name) in user profile, field machine name as field_name
I want get user list where name field is blank
$uids = \Drupal::entityQuery('user') ->condition('field_name', NULL, 'IS NULL') ->execute(); echo count($uids);
If you want to get more user through user id
foreach($uids as $uid){ $users = User::load($uid); $…