Home › Forums › Feature Requests › Automatic Data Grid generated by two Repeater fields › Reply To: Automatic Data Grid generated by two Repeater fields
Thanks for the screenshot and the explanation.
There are two methods to achieve it, first by using Javascript and second by using PHP code.
The Javascript method will update the last repeater as you editing the other repeater. The problem is this method is hard to achieve. You need advanced JS code because ACF uses a complex code for the repeater field. If you want to do it, please take a look at this page to learn more about JS and ACF: https://www.advancedcustomfields.com/resources/adding-custom-javascript-fields/.
The PHP method is easier, but you need to save the page first before the last repeater is populated with the values. This method uses the acf/save_post hook and the update_field() to do it.
Here are some threads with the similar issue: https://support.advancedcustomfields.com/forums/topic/prepopulate-custom-fields-based-off-of-taxonomy/, https://support.advancedcustomfields.com/forums/topic/populate-flexible-content-rows-programmatically/.
I hope this helps 🙂
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’re reaching out to our multilingual users to ask for help in translating ACF 6.1. Help make sure the latest features are available in your language here: https://t.co/TkEc2Exd6U
— Advanced Custom Fields (@wp_acf) May 22, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.