How to Retrieve form `entry_id` from a Gravity Forms Submission for 3rd-Party Integration
Opened this issue · 0 comments
stotes commented
Description:
I am working on integrating Gravity Forms submissions with a third-party service using the "Forms: 3rd-Party Integration" WordPress plugin. I need to pass the entry_id
of the submitted form along with the form_id
to the third-party service. However, I am encountering difficulties in retrieving the entry_id
from the form submission.
What I've Tried:
I attempted to use GFFormsModel::get_current_lead()
to get the entry_id
, but it seems that the id
is not available in the $lead
object returned by this function. Here's the snippet of my current implementation:
function form_add_entry_id_form_id($post, $service, $form, $sid) {
$lead = GFFormsModel::get_current_lead();
$post['entry_id'] = null; // Unable to get entry_id here
$post['form_id'] = $form['id'];
return $post;
}
add_filter('Forms3rdPartyIntegration_service_filter_post', 'form_add_entry_id_form_id', 10, 4);
Specific Questions:
- Is there an alternative method or a specific Gravity Forms function that I should use to reliably get the entry_id during or after the form submission?
- Should I be using a different approach or hook within Gravity Forms to ensure that I have access to the entry_id when executing my custom function for the 3rd-Party Integration?
I would appreciate any guidance or suggestions on how to resolve this issue. Thank you!