Get all user profiles from list of users I am evaluating some custom code in a rule. I want to get a list of users, then load all of the associated profiles from the profile2 module. My code below, loads all the users, and I got an array of the UIDs to put into the profile_load_multiple() function but it is just returning one user profile, I want to return all profiles. Eventually I want to compare a term from a field (project resources) in the node 'project' I am creating with a field (resources) that is in each user main profile.  My intention is  using rules to accomplish this.

$users = entity_load('user');
$arrayuids = array();
foreach ($users as $user)
{
array_push($arrayuids, $user-&gt;uid);
}
$profile = profile2_load_multiple($arrayuids, FALSE);
dsm($arrayuids);
dsm($profile);
Your first problem is that you send uids instead of pids. First argument of profile2_load_multiple is $pids which are profile2 ids.

Try this code:

$users = entity_load('user');
$arrayuids = array_keys($users);

$query = new EntityFieldQuery();    
$query-&gt;entityCondition('entity_type', 'profile2')
    -&gt;propertyCondition('uid', $arrayuids, 'IN');

$profile = $query-&gt;execute();

dsm($arrayuids);
dsm($profile);


I haven't tested it but it should work.