gravityflowformconnector_update_entry_id

The gravityflowformconnector_update_entry_id filter allows the target entry ID to be modified.

Parameters

Parameter Type Definition
$target_entry_id Integer The target entry id.
$target_form_id Integer The target form id.
$entry Array The current entry object.
$form Array The current form object.
$step Array The current step object.

Examples

Example 1 - Custom search for the target entry ID based on the value of field ID 4.

add_filter( 'gravityflowformconnector_update_entry_id', 'sh_gravityflowformconnector_update_entry_id', 10, 5);
  function sh_gravityflowformconnector_update_entry_id( $target_entry_id, $target_form_id, $entry, $form, $step ) {
      // Custom search for the target entry ID based on the value of field ID 4.
      $search_criteria['status'] = 'active';
      $search_criteria['field_filters'][] = array( 'key' => '2', 'value' => $entry['4'] );
      $entries = GFAPI::get_entries( $target_form_id, $search_criteria );
      // Return the ID of the first entry in the results.
      return $entries[0]['id'];
  }

Placement

This code should be placed in the functions.php file of your active theme or in a custom functions plugin.