Support

Account

Home Forums Feature Requests Automatic Data Grid generated by two Repeater fields Reply To: Automatic Data Grid generated by two Repeater fields

  • Hi @malte-seidel

    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 🙂