Support » Plugin: MaxiCharts » Cannot filter data with the custom_search_criteria

  • Resolved pierrethenot

    (@pierrethenot)


    Hi,

    I’m having a hard time trying to implement the custom_search_criteria to display the gravity form field id 2 but only if the field id 42 and value 2 was selected. If I try this shortcode below, it displays the same results no matter the value I use and it doesn’t filter.

    Can you help me figure out the issue?

    Regards,

    Pierre

    <?php echo do_shortcode(‘[gfchartsreports gf_form_id=”1″ include=”2″ height=”400px” type=”pie” maxentries=”10000″ chart_js_options=”title: {display: false}” custom_search_criteria=”{“status”:”active”,”field_filters”:{“0”:{“key”:”42″,”value”:”2″}}}”]’); ?>

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author maxicharts

    (@maxicharts)

    Hi @pierrethenot,

    Have you seen this example page : https://maxicharts.com/custom-search-criteria-filter-by-field-values/

    Please replace external double quote with simple quote :

    custom_search_criteria=”{“status”:”active”,”field_filters”:{“0”:{“key”:”42″,”value”:”2″}}}”

    custom_search_criteria='{“status”:”active”,”field_filters”:{“0”:{“key”:”42″,”value”:”2″}}}’

    and try again

    Hi,

    I’m getting a blank page if I use the simplequote inside the php (do_shortcode). I think it’s because of the simple quote iteration and the fact that the double quote doesn’t work with the shortcode custom search setting. I can only use the shortcode inside the wordpress editor and not directly inside the template. Do you have a solution to use it inside the php template?

    Cheers,

    Pierre

    Plugin Author maxicharts

    (@maxicharts)

    It should work escaping the single quotes of criteria parameter with a backslash before:

    \’

    Plugin Author maxicharts

    (@maxicharts)

    custom_search_criteria=\'{“status”:”active”,”field_filters”:{“0”:{“key”:”42″,”value”:”2″}}}\’

    Awesome! Thanks, I forgot about that trick.

    Cheers,

    Pierre

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Cannot filter data with the custom_search_criteria’ is closed to new replies.