I have been working on a form (form_id_3) / subform (nested form_id_2).
On nested form, each time entry is submitted, i would like to trigger all flow steps (webhook will fill some fiedls in nested form.
Tried code below without success
add_action( 'gform_after_submission', 'my_nested_form_action' );
function my_nested_form_action( $entry ) {
if ( $entry['form_id'] == 2 ) {
$nested_entries = GFAPI::get_entries( $entry['form_id'] );
foreach ( $nested_entries as $nested_entry ) {
GFAPI::run_workflow_steps( $nested_entry['id'] );
}
}
}
Can anyone help me say what i am doing wrong?