Save EP Token to Field

This snippet allows you to populate the EP token into a field so it can be mapped in Gravity Forms feeds. The filter fires before feeds are processed so the token is available in time.

Instructions

See “Where do I put snippets?” in our documentation for installation instructions.

Code

Filename: gpep-save-token-to-field.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
/**
 * Gravity Perks // Easy Passthrough // Save EP Token to Field
 * https://gravitywiz.com/documentation/gravity-forms-easy-passthrough/
 *
 * This snippet allows you to populate the EP token into a field so it can be mapped in Gravity Forms feeds. The filter
 * fires before feeds are processed so the token is available in time.
 */
// Update "123" to your form ID.
add_filter( 'gform_entry_post_save_123', function( $entry, $form ) {

	// Update "4" to the ID of the field you woule like to populate with the EP token.
	$target_field_id = 4;

	if ( is_callable( 'gp_easy_passthrough' ) ) {
		$token = gp_easy_passthrough()->get_entry_token( $entry );
		GFAPI::update_entry_field( $entry['id'], $target_field_id, $token );
		$entry[ $target_field_id ] = $token;
	}

	return $entry;
}, 5, 2 );

Comments

  1. Clifford Paulick
    Clifford Paulick April 13, 2026 at 10:27 am

    How’s this any better than just adding a hidden field that’s able to be populated with ‘ep_token’ query parameter?

    Reply
    1. J Yeager
      J Yeager Staff April 13, 2026 at 1:17 pm

      Hey Clifford,

      This snippet is for the scenario where you want to store the ep_token in a field on the source form. What you’re suggesting would work just fine on a target form, where the ep_token would be readily available via that query parameter, but in the case of a source form, this param wouldn’t exist yet in the URL at the initial time of submission.

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.