Adding a frm-stats total based on 2 responses from a dropdown field

By: Ron H | Asked: 02/25/2025
ForumsCategory: Code HelpAdding a frm-stats total based on 2 responses from a dropdown field
Ron H asked 3 days ago

Hello all. I have a form view where I want to show the total number entries from the form that is based on if an entry has 1 of 2 (out of 6 available) response options selected.

The dropdown field ID is 3572 and has the following options (only one can be selected at a time):

  • Received - Under Review
  • Queued for Wednesday Printing
  • Printed - Ready for Pickup
  • Rejected - Improperly Sized PDF
  • Cancelled by Submitter
  • Cancelled - Emergency Interruption<
  • The current version of the code that I have which half works is based on this support page (https://formidableforms.com/knowledgebase/add-field-totals-and-statistics/):

    [frm-stats id=3572 type=count 3572="Received - Under Review"]

    My questions is, can I have the above code count the number of submissions where 3572 is either "Received - Under Review" or "Queued for Wednesday Printing"? 

    1 Answers
    Victor Font Staff answered 2 days ago

    Yes, you can use multiple filters in the same shortcode but the restriction is that they cannot be the same filter. In your case, you want to count for two values in the same field. This would require the use of an OR condition where 3572="Received - Under Review" OR 3572="Queued for Wednesday Printing". This isn't possible within a single frm-stats shortcode call. Your alternatives require custom code. You can create your own shortcode that runs frm-stats twice and then returns the total of the two values, or you can write a custom SQL statement that calculates everything in one step. See this: https://formidableforms.com/knowledgebase/add-field-totals-and-statistics/#kb-field-filters

    Ron H replied 2 days ago

    Thank you for the reply! I appreciate it.

    Victor Font Staff replied 2 days ago

    If custom code is beyond your skillset, please visit https://formidable-masterminds.com/developers-directory/ to find someone to help. It shouldn't take more than an hour or two to write the code or mentor you to write it yourself.

    Making the Best WordPress Plugin even better - Together

    Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
    Join the community
    crossarrow-right