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
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
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”:”your@email.com”}}’]
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.
OK, I figured it out, now the values are correct, I just need to replace the hardcoded (xxx@gmail.com) 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”:”xxx@gmail.com”}}}’]
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
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: http://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
Resolved 🙂
Thank you again for the great support!