• Resolved viperboys

    (@viperboys)


    Hi guy!
    I am using GForm and GFlow in a project. I am using this plugin to export the input. There is a field called WorkFlow step that should have the name of the step the input is in. The issue is that you have the ID and not your name.

    Very useful this plugin ..

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Doeke Norg

    (@doekenorg)

    Hi @viperboys,

    I’m a bit swamped at the moment. It sounds like your previous question, so the answer is partly the same. You have to find out what the type of the field is to fill out the hook name (gfexcel_field_value_…) and use some api of flow to retrieve the label. I’ll see when I have some extra time. But could be next week unfortunately.

    Thread Starter viperboys

    (@viperboys)

    Hi @doekenorg
    I would greatly appreciate it.I have tried but have not been successful.

    Plugin Author Doeke Norg

    (@doekenorg)

    Hi @viperboys, took some doing; but this should help you out.

    /**
     * Export workflow_step as the name of the step in Gravity Forms Entries in Excel.
     */
    add_filter('gfexcel_meta_value_workflow_step', static function($value, $entry) {
        $flow = function_exists('gravity_flow') ? gravity_flow() : null;
        if (!$flow instanceof \Gravity_Flow) {
            return $value;
        }
    
        return $flow->get_step( $entry['workflow_step'], $entry )->get_name();
    }, 10, 2);

    Hope this helps you out.

    Thread Starter viperboys

    (@viperboys)

    Hi @doekenorg

    I add the code, then download the file and I got this error.

    There has been a critical error on your website.

    Check the wordpress log and I have these errors.

    [14-Sep-2020 13:49:04 UTC] PHP Fatal error: Uncaught Error: Call to a member function get_name() on bool in /home/apropi93/public_html/luxflowapp/wp-content/plugins/code-snippets/php/snippet-ops.php(446) : eval()’d code:10
    Stack trace:
    #0 /home/apropi93/public_html/luxflowapp/wp-includes/class-wp-hook.php(289): {closure}(”, Array)
    #1 /home/apropi93/public_html/luxflowapp/wp-includes/plugin.php(206): WP_Hook->apply_filters(”, Array)
    #2 /home/apropi93/public_html/luxflowapp/wp-content/plugins/gravityforms/gravityforms.php(5913): apply_filters(‘gfexcel_meta_va…’, ”, Array, Object(GF_Field), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
    #3 /home/apropi93/public_html/luxflowapp/wp-content/plugins/gf-entries-in-excel/src/Field/MetaField.php(47): gf_apply_filters(‘gfexcel_meta_va…’, ”, Array, Object(GF_Field))
    #4 /home/apropi93/public_html/luxflowapp/wp-content/plugins/gf-entries-in-excel/src/Transformer/Combiner.php(97): GFExcel\Field\MetaField->getCells(Array)
    #5 /home/apropi93/public_html/luxflowapp/wp-content/plugins/gf-entries-in-excel/src/Tran in /home/apropi93/public_html/luxflowapp/wp-content/plugins/code-snippets/php/snippet-ops.php(446) : eval()’d code on line 10
    [14-Sep-2020 13:49:04 UTC] PHP Warning: array_merge(): Expected parameter 1 to be an array, null given in /home/apropi93/public_html/luxflowapp/wp-content/plugins/hide-my-wp-frontend/index.php

    I am very grateful for your great help.

    Plugin Author Doeke Norg

    (@doekenorg)

    Hi @viperboys,

    ah sorry. Should have been a bit more defensive coding. Try this:

    /**
     * Export workflow_step as the name of the step in Gravity Forms Entries in Excel.
     */
    add_filter('gfexcel_meta_value_workflow_step', static function($value, $entry) {
        $flow = function_exists('gravity_flow') ? gravity_flow() : null;
        if (!$flow instanceof \Gravity_Flow || !$step = $flow->get_step( $entry['workflow_step'], $entry )) {
            return $value;
        }
    
        return $step->get_name();
    }, 10, 2);
    Thread Starter viperboys

    (@viperboys)

    Hi @doekenorg
    This is great… Thank you again ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to change the ID of the step by its respective name for GravityFlow’ is closed to new replies.