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,
);
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.