I thought that this example in the docs would solve my issue but it's not quite what I need...
https://formidableforms.com/knowledgebase/frm_after_create_entry/#kb-create-entry-in-form-with-repeating-section
Form A has a repeating section with a field that stores the id of the entry in Form B that has another repeating field that needs an entry added to it based on the values in Form A.
I've used the frm_after_create_entry hook to capture the fields I need in Form A to create the entry in the repeating field in Form B but I can't seem to figure out how to insert the new entry.
What function do I need to use and how do I need to format the input so it inserts the row in the repeating field properly?
I've tried
FrmEntryMeta::add_entry_meta( $reg_entry_id, $repeater_field_id, null, $repeating_values );
and
FrmEntryMeta::update_entry_meta( $reg_entry_id, $repeater_field_id, null, $repeating_values );
but neither seem to work. The repeating values is an array with the field id/value pairs and I've tried several different formats but nonthing seems to work. Any help would be much appreciated.
<p>Thanks! This helped in building the array that got passed into the add_entry_meta method but when I run it and the Form B already has valus in the repeating section it replaces them and doesn't add to the already existing list. How do I force it to add and not update?</p>
@Rob LeVine - I'm still not where I need to be with this. If you have any examples of how to do this that would be much appreciated. My main issue right now is it's not inserting the rows into the repeating section if rows already exist. It's just updating and replacing the existing values.
Can you send me what you have currently? Feel free to send me a message via the community and we can connect "offline".
Please login or Register to submit your answer