access profile2 fields values
Just define the  variable already before using it 

$profile ="";
global $user;
$profile = profile2_load_by_user($user-&gt;uid, 'main');
$checkbox1 = isseet($profile-&gt;field_checkbox_admin1['und'][0]['value']) ?      $profile-&gt;field_checkbox_admin1['und'][0]['value'] : "";


That is nature the profile 2 module, it doesn't create any entry for any field in the database untill it is not assigned any value actually. So it returns nothing if it is empty.

Hope it will help