Support

Account

Home Forums ACF PRO update_field with nested groups and repater fields. Reply To: update_field with nested groups and repater fields.

  • I’m trying another approach but without luck…

    if( have_rows( 'company', $post_id ) ):
    	while( have_rows('company', $post_id ) ) : the_row(); //group field
    		if( have_rows('addresses') ):
    			while( have_rows('addresses') ) : the_row(); //repeater field
    				if( have_rows('address') ):
    					while( have_rows('address') ) : the_row(); //group field
    						update_sub_field( 'formatted_address',  $geocode['formatted_address'] );
    					endwhile;
    				endif;
    			endwhile;
    		endif;
    	endwhile;
    endif;

    Any idea ?
    Thanks