Process Feed when a New Entry is Created via Gravity Flow Form Connector.

Process Google Sheet feeds when a new entry is created.

Instructions

Code

Filename: gcgs-process-feed-on-gravityflowformconnector-new-entry.php

<?php
/**
 * Gravity Connect // Google Sheets // Process Feed when a New Entry is Created via Gravity Flow Form Connector.
 * 
 * Instruction Video: https://www.loom.com/share/7c5b3b5e286648538bf4a2326333f4d7
 *
 * Process Google Sheet feeds when a new entry is created.
 */
add_action( 'gravityflowformconnector_post_new_entry', function ( $new_entry_id, $entry, $form, $step ) {
	if ( function_exists( 'gc_google_sheets' ) && $step->get_type() == 'new_entry' ) {
		$new_entry = GFAPI::get_entry( $new_entry_id );
		$new_form  = GFAPI::get_form( $new_entry['form_id'] );
		gc_google_sheets()->maybe_process_feed( $new_entry, $new_form );
		gf_feed_processor()->save()->dispatch();
	}
}, 10, 4 );

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.