If Profile2 fields are empty, problem in accessing data I just found out that if ALL fields of certain Profile2 profile ie. main are empty, I am not able to access data inside main profile. For example I want to do a check if a field is empty but can not access it using 

global $user;
$account = user_load($user-&gt;uid);
$data = profile2_load_by_user($account);


How can I access the fields? thank you.
I would suspect that profiles only get created when needed, hence when it is saved with field values.

You most probably then are trying to look at a profile of a user who does not yet have a profile. You should do a test on $data. If it is null or false, then you should assume that the user has no profile and that the fields are in effect empty. If you want to alter the fields then you must set up a profile object and save it after validation. 

The docs for profile2_load_by_user is misleading as it indicates that there will always be a profile returned, but looking through the source code I can see a return value of FALSE.

If there is a profile then return value is either a single profile or an array of profiles, so you must test $data for 3 things: false, object, or array of objects.