Entry Automation Entry Automation

fg_entryautomation_dropbox_file_path

Description

This filter allows you to modify the path where the export file will be written to when using the Dropbox extension.

Usage

Global usage:

add_filter( 'fg_entryautomation_dropbox_file_path', 'your_function_name', 10, 4 );

Form ID specific usage:

add_filter( 'fg_entryautomation_dropbox_file_path_1', 'your_function_name', 10, 4 );

Form ID and Task ID specific usage:

add_filter( 'fg_entryautomation_dropbox_file_path_1_12', 'your_function_name', 10, 4 );

Parameters

Examples

This example shows you how to change the file path to a custom location in Dropbox. The example here grabs the existing path you’ve set in your Connection Settings tab for the task and adds a unique value from an entry.

You will need to replace ‘/Gravity Forms Add-On/’ in the snippet with the path you’ve defined in your task’s Connection Settings tab.

Note: this example will only work with an On Form Submission task.

add_filter( 'fg_entryautomation_dropbox_file_path', function( $remote_file_path, $file_name, $task, $form ) {

    if ( $task['entry_id'] ) {
        $entry = GFAPI::get_entry( $task['entry_id'] );
        $remote_file_path = str_replace( '/Gravity Forms Add-On/', '/Gravity Forms Add-On/' . rgar( $entry, 1 ) . '/', $remote_file_path );
    }

    return $remote_file_path;

}, 10, 4 );