Support

Account

Home Forums ACF PRO Possible to use update_field to append data to repeater? Reply To: Possible to use update_field to append data to repeater?

  • Solved it! I just need to check if there were already existing rows, and append data to that array.

     if( have_rows('directories', $id) ){
                            $value = get_field( 'directories', $id );
                          } else {
                            $value = array();
                          }
                          /*==========  Add New Row  ==========*/
                          
                          $value[] = array(
                            'field_53ed47e4824fd' => $attachment_id, 
                            'field_555caf66e22a3' => $note,
                            'field_53ed1cd943477' => $date,
                            'field_53ed1b70f2796' => $list_ID,
                          );