• Resolved wordpress-org

    (@wordpress-org)


    How can I add an additional filter to the custom search below to also filter

    current logged in ”user_email” = form field submission {email:3}

    custom_search_criteria='{ can anyone fill in this blank please ?? }’

    Here is a current user’s created values example:
    custom_search_criteria='{“status”:”active”,”field_filters”:{“0”:{“key”:”created_by”,”value”:”current”}}}’

    https://www.gravityformschartsreports.com/2017/03/16/all-shortcode-parameters/

    Thank you
    Joe

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author termel

    (@munger41)

    Hi Joe,
    I am not sure i really understand what you want to do.
    What do you need to filter ?
    The custom_search_criteria parameter value is passed to gravity forms get_entries API, there are some examples here : https://www.gravityhelp.com/documentation/article/api-functions/#get_entries

    Thread Starter wordpress-org

    (@wordpress-org)

    Thank you for your prompt reply.

    Using the standard GF API filter Entries by Meta (see below) how can I filter results if I only want the results where the form field’s submitted {email:3} value, equals (a specific email address, in my case) the current user’s username. (in my case the username is an email)

    custom_search_criteria='{”field_filters”:{“ ? ”:{“key”:” ? ”,”value”:” ? ”}}}’

    ______________________________________________________________________

    STANDARD GF API:
    Filter entries by Entry meta (added using the gform_entry_meta hook)
    $search_criteria[‘field_filters’][] = array( ‘key’ => ‘gquiz_score’, ‘value’ => ‘1’ );

    ______________________________________________________________________

    Thank you,
    Joe

    Thread Starter wordpress-org

    (@wordpress-org)

    I was trying this but is not working :(((

    [gfchartsreports gf_form_id=”24″ include=”1″ type=”doughnut” custom_search_criteria='{“field_filters”:{“key”:”3″,”value”:”username”}}’]

    Plugin Author termel

    (@munger41)

    Why don’t you set the email you want to filter directly ?

    [gfchartsreports gf_form_id=”24″ include=”1″ type=”doughnut” custom_search_criteria='{“field_filters”:{“key”:”3″,”value”:”[email protected]”}}’]

    I haven’t tested but if you give me a couple of days i will.

    If what you want is filter entries based on current user email, i think this is not possible with GF API.

    Thread Starter wordpress-org

    (@wordpress-org)

    OK, I figured it out, now the values are correct, I just need to replace the hardcoded ([email protected]) email with the email for current user:

    [gfchartsreports gf_form_id=”24″ include=”1″ type=”doughnut” custom_search_criteria='{“field_filters”:{“0”:{“key”:”3″,”value”:”[email protected]”}}}’]

    Plugin Author termel

    (@munger41)

    Ok, you cannot do that currently with the plugin, this would need a little dev from our team, please let me do it in a couple of days.
    thanks

    Thread Starter wordpress-org

    (@wordpress-org)

    THANK YOU SOOOOOO MUCH!!!
    I am super grateful for your help.

    Plugin Author termel

    (@munger41)

    Version 2.6.2+ should do the trick. Use something like this: https://www.gravityformschartsreports.com/custom-search-criteria-current-user-data/

    Please test and tell me if it works for you.
    Cheers

    Plugin Author termel

    (@munger41)

    Can you confirm it works please ? if yes, can you close this thread ?
    Cheers

    Thread Starter wordpress-org

    (@wordpress-org)

    Resolved ??
    Thank you again for the great support!

    Plugin Author termel

    (@munger41)

    With pleasure!
    ??

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Custom Search Criteria with Multiple Filters’ is closed to new replies.