Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To retrieve the value of a nested form entry in Gravity Forms, you can use the gform_get_meta() function. This function takes two parameters: the entry ID and the meta key.

First, you need to get the parent form entry ID. You can do this by getting the entry object and accessing its post_id property, like this:

$entry = GFAPI::get_entry( $entry_id );
$parent_entry_id = $entry->post_id;

Once you have the parent form entry ID, you can use it to retrieve the nested form entry meta value. The meta key is the field ID of the nested form field, followed by the string "id". For example, if the nested form field ID is "3", the meta key would be "3id". Here's an example of how to use gform_get_meta() to retrieve the nested form entry ID:

$nested_form_entry_id = gform_get_meta( $parent_entry_id, '3_id' );

You can then use the nested form entry ID to retrieve any other field values from the nested form, using GFAPI::get_entry() again.