Custom Search Criteria

Custom Search Criteria

The advanced custom_search_criteria parameter provide a way to pass to gravity form submission query, a set of filters, as defined by their API documentation here.

MaxiCharts added a simple logical layer concerning user filtering, in order to set the created_by key to value current in order to filter entries based on currently logged in WP user.

Example : filter only admin entries

[gfchartsreports color_set="purple" float="true" width="30%" color_rand="true" custom_search_criteria='{"status":"active","field_filters":{"0":{"key":"created_by","value":"1"}}}']

Compare with the same graph without filter (including all user answers).

Example 2 : date range

Shortcodes

[gfchartsreports type="horizontalBar" chart_js_options="title: {display: true, text: 'Today'}" gf_form_id="6" color_set="blue" position="float" include="1" width="32%" custom_search_criteria='{"date_range":"today"}']
[gfchartsreports type="horizontalBar" chart_js_options="title: {display: true, text: 'Yesterday'}" gf_form_id="6" color_set="blue" float="true" include="1" width="32%" custom_search_criteria='{"date_range":"yesterday"}']
[gfchartsreports type="horizontalBar" chart_js_options="title: {display: true, text: 'Last week'}" gf_form_id="6" color_set="blue" position="float" include="1" width="32%" custom_search_criteria='{"date_range":"last_week"}']
[gfchartsreports type="horizontalBar" gf_form_id="6" chart_js_options="title: {display: true, text: 'Last month'}" color_set="blue" position="float" include="1" width="48%" custom_search_criteria='{"date_range":"last_month"}']
[gfchartsreports type="horizontalBar" chart_js_options="title: {display: true, text: 'Last year'}" gf_form_id="6" color_set="blue" float="true" include="1" width="48%" custom_search_criteria='{"date_range":"last_year"}']

About The Author

Comments (5)

  • Joe Black

    Would you please test the date_range custom_search_criteria as they are returning the same results (at least in my case, and it looks like it in the example above as well at the moment).

    Also, can you include a “today” and “yesterday” option.

    Thank you.

    • Gravity Forms Charts Reports

      added today and yesterday : to be tested…

  • Gravity Forms Charts Reports

    Hello Joe!
    Sure i will add this! Keep you posted

  • saaidis@icloud.com

    Hello, thank you for this amazing plugin !
    Can you please explain how to do range for numbers ?

    explanation : the visitor enter his yearly income, so i have a lot of values for all visitors and i need to make range of yearly income to show them on a nice MaxiCharts.

    Thanks !

    • MaxiCharts

      Hi,
      Thanks for your feedback, what do you mean by range? Min and max? How are you planning to show this on a chart? Can you provide a link to an example page?

Leave Comment