Support

Account

Home Forums General Issues How to fill group field with data Reply To: How to fill group field with data

  • When updating a field that does not exist yet you need to use the field key rather than the field name.

    When dealing with a group field, it can only have one row so I would bypass the loop and add_row and to

    
    $value = array(
      // sub field key/value pairs
      'field_12345' => 'value 1',
      'field_34567' => 'value 2',
      // etc....
    );
    update_field('field_xyz123', $value, $post_id);