• Resolved pfritz333

    (@pfritz333)


    I love this plug-in. However, I’m struggling to figure out how to use the ‘isnot’ operator in the following shortcode. Can you please help?

    I’m collecting customer complaints, and I want to show only those that apply to field 10: “SA – MT BARKER” (that part works fine), but also exclude all form submissions where field 6 equals “Praise”. What am I doing wrong?

    [gravitywp_count formid=”2″ filter_field=”6″ filter_operator=’isnot’ filter_value=”Praise” filter_field=”10″ filter_value=”SA – MOUNT BARKER”]

    ***
    Thanks so much for your help. ??

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

    (@gravitywp)

    Thanks for the kind message.

    You should number the filters separately:

    [gravitywp_count formid=”2″ filter_field=”6″ filter_operator=’isnot’ filter_value=”Praise” filter_field2=”10″ =”SA – MOUNT BARKER”]

    So when using multiple filters you can use filter_field2 (in combination with filter_value2, filter_operator2), filter_field3 etc etc

    Hope this helps,

    Erik

    Plugin Author GravityWP

    (@gravitywp)

    I see that I accidentally deleted the 2nd filter_value, see here for correct shortcode you can use:

    [gravitywp_count formid=’2′ filter_field=’6′ filter_operator=’isnot’ filter_value=’Praise’ filter_field2=’10’ filter_value2=’SA – MOUNT BARKER’]

    Thread Starter pfritz333

    (@pfritz333)

    Erik – thank you so much for your very quick response. Unfortunately, it’s returning a result of 0 when it should, in fact, be 14 (16 feedback submissions for SA – MOUNT BARKER, minus 2 that are ‘Praise’). I’ve used this:

    [gravitywp_count formid=’2′ filter_field=’6′ filter_operator=’isnot’ filter_value=’Praise’ filter_field2=’10’ filter_value2=’SA – MOUNT BARKER’]

    – The form ID is 2.
    – The Feedback Type dropdown (which contains options like Praise, Wrong order, Cold food, Wait time, etc.) is Field ID 6.
    – The Restaurant Location dropdown (which contains options like SA – KILBURN, SA – MOUNT BARKER, VIC – KNOX, etc.) is Field ID 10.

    Amy I missing something?

    Thanks. Peter.

    Plugin Author GravityWP

    (@gravitywp)

    Hi Peter,

    The plugin searches for the actual value of a field, so not the label. Can it be that you have values that differ from the label of the dropdowns?

    Otherwise please send me the export of your form, so I can have a look.
    [email protected]

    Thread Starter pfritz333

    (@pfritz333)

    No, the values are identical. I’ll send you the form. Thank you for looking into this. Happy to pay you after we’re done. ??

    Plugin Author GravityWP

    (@gravitywp)

    This problem is solved, I’m adding this answer for other people that have the same question.

    So first: I tried with only the formid (and used the shortcode that didn’t work as a basis).

    [gravitywp_count formid=’2′]

    This didn’t work. This has to do with the wrong use of parentheses. I cleaned it up and than it worked again.

    [gravitywp_count formid='2']

    So next, it didn’t work selecting for SA – MOUNT BARKER.

    [gravitywp_count formid=’2′ filter_field2=’10’ filter_value2=’SA – MOUNT BARKER’]

    It turned out that the dash used in the middle of SA and MOUNT BARKER is different from the dash you use in the value field in the dropdown. The plugin than correctly shows 0, because it can’t find an exact match. I cleaned it up and copied the value from the dropdown into the plugin. Than it worked:

    [gravitywp_count formid='2' filter_field2='10' filter_value2='SA - MOUNT BARKER']

    The isnot Praise worked good (I did clean up all the parantheses and kept them in one style).

    [gravitywp_count formid='2' filter_field='6' filter_operator='isnot' filter_value='Praise' filter_field2='10' filter_value2='SA - MOUNT BARKER']

    This last shortcode works as expected. When adding the shortcode, be sure to work in the text (HTML) editor of WP (or notepad) to keep it clean.

    @pfritz333 Again thanks for the donation, very much appreciated! And good luck.

    Erik

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Use Operator with Multiple Filters’ is closed to new replies.