How to fetch group name from query? I'm using Field group Module, I have created 3 groups with name &amp; ID as given below:


Group Name    | Machine ID
Stake Holders | group_sh1  
Trends        | group_td1  
Organization  | group_org1 


I want to retrieve the group name in a custom module. By using "ctools" I'm able to retrieve the id  of the group, but couldn't get name of the group. Please find the code below for your reference.

ctools_include('export');
$objects = ctools_export_load_object('field_group', 'conditions', array(
    'entity_type' =&gt; 'node',
    'bundle' =&gt; DIGITAL_IQ,
  ));

$object = array_shift($objects);
if ($object &amp;&amp; isset($object-&gt;data)) {
  dpm(field_group_unpack($object)children);
}



  --Result---
  0 (String, 9 characters ) group_sh1
  1 (String, 9 characters ) group_td1
  2 (String, 10 characters ) group_org1


How can I retrieve the group name?
//Get the Field information.
$field = field_info_instance('node', 'field_business_challenge', DIGITAL_IQ);


//Obtain group of that field.
$field_group = field_get_field_group($field); 


//Get the name of the group from the Lable Attribute.
dpm($field-&gt;Lable);


There you go, you have the group name.