Insert the following shortcode on a page, post, View, or in any field in your form.
[frm-stats id=x type=count]
Replace x with the ID or key of the field you want to display statistics for. Replace count with the type of statistics to display (all the different types are listed below).
From Idea to Reality in Minutes. Build Powerful Forms, Dashboards, Apps and More.
Formidable Forms makes advanced site building simple. Launch forms, directories, dashboards, and custom WordPress apps faster than ever before.
Include only entries from a specific user in the form statistic. This must be an integer or 'current'. To get a user ID integer, go into Users, select a user, and the user ID number will be in the address bar. Example: [frm-stats id=x type=count user_id=current]
Get a total for a specific entry or entries. Use entry IDs or keys. Example: [frm-stats id=x type=star entry="250,252,255"]. In a View you can use [frm-stats id=x type=star entry="[id]"]
You can get stats about the Repeaters of a particular parent entry using the parent_id param. Set parent_id to the id or key of the parent entry, and use a field in the Repeater for the stats. The parent_id param is especially useful in a View of the parent, where you can set parent_id to [id].
Set the thousands separator for the displayed number. When you use thousands_sep or dec_point, the number always shows the number of decimal places set by the decimal parameter (2 by default). That includes trailing zeros. Add decimal=0 to show a whole number, such as a count. Example:
Determine the maximum number of decimal places to show. On its own, this option doesn't add trailing zeros. With thousands_sep or dec_point, it sets the exact number of decimal places. Example:
Determine which character is used as the decimal point in the displayed number. By default, this is a period. The thousands separator stays a comma unless you set thousands_sep too, so set both when you use a comma as the decimal point. This example shows 1.090,25:
By default, the frm-stats shortcode uses only submitted entries. It doesn't include drafts or spam entries. You can choose to include only drafts, submitted entries and drafts, or entries with any status. This shortcode counts only drafts:
[frm-stats id=x type=count drafts=1]
This shortcode counts both drafts and submitted entries:
[frm-stats id=x type=count drafts=both]
This shortcode counts every entry, whatever its status. That includes spam entries, and the in-progress and abandoned entries saved by Form Abandonment:
Only include entries created after a specific or dynamic date. For example, you may total entries created in the last month with created_at_greater_than="-1 month" or use a specific date like created_at_greater_than="2016-07-31". When using a specific date, it must be in the Y-m-d format.
Only include entries created before a specific or dynamic date. For example, you may total entries created before today with created_at_less_than="-1 day" or use a specific date like created_at_less_than="2016-05-31". When using a specific date, it must be in the Y-m-d format.
Only include entries where a field in the same form is equal to, not equal to, greater than (or equal to), less than (or equal to), or contains a specific value.
Note: you can use multiple field filters in the same shortcode to get more refined statistics. However, you can't use the exact same filter twice in the same stat. So you can have 50_greater_than=10 and 50_less_than=20 in the same stat, but not 50="silver" and 50="gold".
If a field has separate values, the field filter will use the saved value.
Replace 25 with the ID of any field in the form. Replace param_name with your parameter name.
Use this filter in a View. In page or post content, WordPress doesn't run a shortcode placed inside another shortcode's parameter, so the stat shows the wrong value.
A stat for a field in a Repeater can also be filtered by a field in the parent form. Each Repeater row is counted when its parent entry matches the filter. For example, this shortcode totals an Hours field in a Repeater. It only counts rows whose parent entry has "Red" in the Team field:
[frm-stats id=x type=total 25="Red"]
Replace x with the ID of the field in the Repeater. Replace 25 with the ID of the field in the parent form. All the filter types above work this way, and you can combine a parent form filter with a filter on another Repeater field.
It also works the other way around: a stat for a field in the parent form can be filtered by a field in a Repeater. For example, this shortcode totals a Score field in the parent form. It only counts entries that have at least one Repeater row with "Blue" in the Color field, and it counts each of those entries once, even when several rows match:
[frm-stats id=x type=total 25="Blue"]
Replace x with the ID of the field in the parent form. Replace 25 with the ID of the field in the Repeater.
To count how often a specific value is submitted in a form, add a filter to the [frm-stats] shortcode. A common use for this is when you have a course registration form and want to count the number of students enrolled in each course.
This example needs the Visual Views add-on, which is available on the Plus, Business, and Elite licenses. If it isn't active yet, install and activate it from the Formidable → Add-Ons page.
Go to Formidable → Forms, click Add New, and create a blank form. The first time you click Save, name the form Add a Course Form. This form holds the course names and descriptions that the Lookup field retrieves.
Add a Text field with the label Course Name. In its field options, check the Unique box. Then add a Paragraph field with the label Course Description, and click Update to save the form.
Import a CSV with all of the course names and descriptions into the Add a Course Form. The CSV headings must match the fields. If you don't have a CSV to import, add the entries by hand.
Create a second form called Registration Form. Students use this form to sign up for a course. You can add any fields that you want.
Add a Lookup field with the label Course Name. In its field options:
Set Display Type to Dropdown or Radio Buttons.
Under Get Options From, select Add a Course Form and then its Course Name field.
Click Update. The builder then shows Add Fields, so click the Lookup field again to reopen its options. The field ID shows next to Lookup Field at the top. Note it, because you need it in step 10.
Go to Formidable → Views and click Add New. Hover over Table and click its + icon. This example uses a Table View.
Enter Course List View as the View Name. In the Use Entries from Form dropdown, select Add a Course Form, and click Create a view.
In the Customize view step, check Course Name and Course Description, and click Create a view. The View editor opens with a column for each field.
To add the third column, click the + icon at the right end of the table header. In the Column Name box, enter Number of Students, and then click anywhere outside the box. In the next image, 9 marks the + icon at the end of the header, and 10 marks the + icon in the new column's first cell.
Click the + icon in the first cell of the Number of Students column. In the Edit Listing Page Content box, add a stat that counts the number of students who signed up for each course. Then click Update.
[frm-stats id=821 type=count 821="[818]"]
Replace 821 with the ID or key of the Course Name Lookup field from the Registration Form. This is the ID you noted in step 5. The Fields tab doesn't list it, because it lists only the fields of the View's form.
Replace 818 with the ID or key of the Course Name field from the Add a Course Form. The Fields tab on the right lists its ID.
Click Update at the top of the View editor to save the View.
That's it! When you preview the Course List View or publish it, it counts the number of students who signed up for each course.
This shortcode will get the total entry count across all forms for the current user. Add this function to your theme functions.php or to a new plugin, and add the shortcode [entry-count] in your page.
add_shortcode('entry-count','my_entry_count');
function my_entry_count($atts){
global $user_ID;
$ids = FrmDb::get_col( 'frm_items', array('user_id' => $user_ID));
return count($ids);
}
This creates a new shortcode [fields-stats] for use on your page. Your shortcode will look like this:
[fields-stats ids="9208,9235" type=count]
Replace 9208 and 9235 with the IDs of the fields you want to total. Note: You need to include the type parameter in the shortcode to display the total.
This creates a new shortcode that allows you to subtract one stat from the other. The stats need to be the same type (such as total or count). They can't have any filters or use any other parameters that are specific to one stat but not the other. Usage: [subtract-fields total=358 removed=359 type=total]. Replace 358 with the id of the field that holds the initial total and 359 with the id of the field that holds the amount being subtracted from the total.
After inserting this function in a new plugin or in your theme functions.php, add the shortcode [frm-percent id=x value="Option 1"] on your page. To set the number of decimal places, add round. For example, [frm-percent id=x value="Option 1" round=0] shows a whole number.
Sometimes, it makes sense to create your own customized shortcode to retrieve a specific value you want. In this example, the number of spaces remaining at an event is calculated using the stats shortcode. You can use [remaining] to display this number wherever you like on your site.
add_shortcode( 'remaining', 'ff_simple_remaining_places' );
function ff_simple_remaining_places( $atts ) {
$places_taken = FrmProStatisticsController::stats_shortcode( array(
'id' => 361,
'type' => 'count'
) );//change 361 to the id of the field you want to count
$remaining_places = 15 - $places_taken;//change 15 to the total number of spaces at the event
return $remaining_places;
}
Replace 361 with the id of the field you want to count. Replace 15 with the total spaces for the event. Note: if you like, you can replace "count" with "total" if more than one person can sign up for the event on one form.
You must log in to vote
Was this article helpful? *
This article may contain affiliate links. Once in a while, we earn commissions from those links. But we only recommend products we like, with or without commissions.
In this article
Get More Done In Less Time With Better
WordPress Forms
Upgrade your
workflow with advanced WordPress forms and integrated Views.
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
This website uses cookies
Websites store cookies to enhance functionality and personalise your experience. You can manage your preferences, but blocking some cookies may impact site performance and services.
Essential cookies enable basic functions and are necessary for the proper function of the website.
Name
Description
Duration
Geolocation Config
This cookie is used to store the consent settings based on the visitor's location.
90 days
Cookie Preferences
This cookie is used to store the user's cookie consent preferences.
90 days
These cookies are needed for adding comments on this website.
Name
Description
Duration
comment_author
Used to track the user across multiple sessions.
Session
comment_author_email
Used to track the user across multiple sessions.
Session
comment_author_url
Used to track the user across multiple sessions.
Session
Easy Digital Downloads is a complete eCommerce solution for WordPress.
Name
Description
Duration
edd_items_in_cart
Stores information about the cart.
Session
edd_session_
Stores information about the current user session.
Session
Formidable Forms is used to manage forms on this website.
Name
Description
Duration
frm_form_
Saves the ID of the form and the time the entry was submitted.
2 hours
These cookies are used for managing login functionality on this website.
Name
Description
Duration
wordpress_logged_in
Used to store logged-in users.
Persistent
wordpress_sec
Used to track the user across multiple sessions.
15 days
wordpress_test_cookie
Used to determine if cookies are enabled.
Session
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a web analytics service offered by Google that tracks and reports website traffic.
Used to determine if the user is in a new session/visit.
Session
__utmt
Used to throttle request rate.
10 minutes
__utmv
Used to store visitor-level custom variable data.
2 years
__utmz
Stores the traffic source or campaign that explains how the user reached your site.
6 months
LinkedIn is a professional networking platform for job seekers, employers, and industry connections.
Name
Description
Duration
fcookie
Used for bot detection.
7 days
AnalyticsSyncHistory
Used to store information about the time a sync with the lms_analytics cookie took place for users in the Designated Countries
30 days
ccookie
To remember if a user received a captcha challenge.
20 minutes
lissc
Pending
1 year
ABSELB
This is Load Balancer Cookie for affiliate marketing
2 years
spectroscopyId
These cookies are set by LinkedIn for advertising purposes, including: tracking visitors so that more relevant ads can be presented, allowing users to use the 'Apply with LinkedIn' or the 'Sign-in with LinkedIn' functions, collecting information about how visitors use the site, etc.
session
brwsr
This cookie is used to Affiliate Marketing Cookie for LinkedIn
2 years
UserMatchHistory
These cookies are set by LinkedIn for advertising purposes, including: tracking visitors so that more relevant ads can be presented, allowing users to use the 'Apply with LinkedIn' or the 'Sign-in with LinkedIn' functions, collecting information about how visitors use the site, etc.
session
lihc_auth_
Used by LinkedIn HelpCenter Live Chat to store language and chat start timestamp. Example names of this cookie include lihc_auth_en, lihc_auth_es, depending on language preference.
Session
lang
Used to remember a user's language setting
session
li_a
Used to authenticate enterprise users on Sales Navigator and Recruiter
30 days
li_gc
Used to store guest consent to the use of cookies for non-essential purposes
2 years
li_ep_auth_context
User to authenticate LinkedIn enterprise customers
30 days
li_rm
Used as part of the LinkedIn Remember Me feature and is set when a user clicks Remember Me on the device to make it easier for him or her to sign in to that device
1 year
bscookie
Used by LinkedIn to track the use of embedded services.
1 year
lms_ads
This cookie is used to identify LinkedIn Members off LinkedIn for advertising
30 days
trkCode
This cookie is used by LinkedIn to support the functionality of adding a panel invite labeled 'Follow Us'
1 year
_guid
This cookie is used to identify a LinkedIn Member for advertising through Google Ads
90 days
trkInfo
This cookie is used by LinkedIn to support the functionality of adding a panel invite labeled 'Follow Us'
1 year
BizographicsOptOut
This cookie is used to determine opt-out status for non-members
10 years
li_oatml
Collects information about how visitors use our site.
30 days
IRLD
This cookie is used for Affiliate Marketing Cookie for LinkedIn
2 years
liap
Cookie used for Sign-in with Linkedin and/or to allow for the Linkedin follow feature.
90 days
l_page
This cookie is used for measuring conversion metrics on LinkedIn
6 months
pushPermInfo
Used across multiple LinkedIn services to determine cool off for push notification prompts
365 days
pushPermState
Used across multiple LinkedIn services to determine the user's push notification permission preference
30 days
ln_or
Used to determine if Oribi analytics can be carried out on a specific domain
1 day
chp_token
Used to denote whether the user has gone through two factor authentication or solved a Captcha.
Session
li_sugr
Used to make a probabilistic match of a user's identity outside the Designated Countries
90 days
lidc
Used by the social networking service, LinkedIn, for tracking the use of embedded services.
1 day
sdsc
This cookie is used for signed data service context cookie used for database routing to ensure consistency across all databases when a change is made. Used to ensure that user-inputted content is immediately available to the submitting user upon submission
Session
bcookie
Used by LinkedIn to track the use of embedded services.
1 year
li_mc
This cookie is used as a temporary cache to avoid database lookups for a member's consent for use of non-essential cookies and used for having consent information on the client side to enforce consent on the client side
6 months
PLAY_FLASH
Used by some LinkedIn services to facilitate the display of messages on page transitions . Users include notifying a user when a form is successfully submitted or fails , and to provide other similar notifications.
Session
li_referer
Used to detect bots. Cookie remembers the referring website before redirecting the user to captcha for authorization
15 minutes
f_token
Used to detect bots for anti-scraping
3 minutes
li_apfcdc
Used for triggering the abuse prevention features on member device.
10 hours
li_odapfcc
Used to control the number of abuse prevention features collected from member device.
2 Years
ac_L
Counts the number of times the account center banner, which is displayed to inform users with an incomplete profile how to complete their profile, was closed by a user to determine display logic
180 days
ac_LD
Contains the date when the account center was displayed to a user to determine display logic
180 days
recent_history_status
Used to determine whether a user enabled or disabled the Guest Recent History Setting
10 years
all_u_b
To know if a user has opted in to viewing LinkedIn on an unsupported browser
21 days
uh
Used to set the user preference for the mobile web platform via a user's settings
Session
abiRedirect
Enables import of address book during onboarding flow for users who choose to import their address book
Session
wwepo
Used to ensure that useres who choose to sign up using phone only have that setting and preference respected
90 days
li_cu
Used to map a user to a captcha challenge page
15 minutes
li_ec
Used to store unbound enterprise users' cookie consent
6 months
denial-client-ip
Stores user IP address for anti-scraping and DOS prevention
5 seconds
li_gpc
Used to remember a user's preferences on LinkedIn's Global Privacy Control
1 hour
denial-reason-code
Used for anti-scraping and DOS prevention
5 seconds
li_gp
Stores privacy preferences for guests to LinkedIn
1 year
rtc
Used as part of anti-abuse processes on LinkedIn
120 seconds
redirectFromM2MInviteSent
Used to notify and provide the appropriate profile display logic when the user sends an invitation to connect on LinkedIn from a LinkedIn member via email.
Session
queryString
This cookie is used to persist marketing tracking parameters
15 days
cookie.policy.banner.eu
Used to display cookie banner in LinkedIn Lite
365 days
cookie.policy.banner.nl
Used to display cookie banner in LinkedIn Lite on the Netherlands site.
365 days
appName
Used to identify the source as the LinkedIn Lite app to send the right service worker to the app
Session
appLang
Used to set the right language on the LinkedIn Lite app
Session
lls-integration
Validates whitelisted partners for content integrations
30 days
feed-sort
Used to remember a member's preference how the feed should be sorted
1 day
integration_type
Used to determine which integration traffic is coming from to render the profile namecard experience
30 days
li_theme_set
Remembers which users have updated their display / theme preferences
6 months
PLAY_LANG
Used by some LinkedIn services to remember a user's language preference
Session
lms_analytics
Used to identify LinkedIn Members off LinkedIn for analytics
30 days
PLAY_SESSION
Used by some LinkedIn services to store session information
Session
li_fat_id
Member indirect identifier for Members for conversion tracking, retargeting, analytics
30 days
redirectFromM2MInviteAccept
Determines the appropriate profile display logic when a user accepts an invitation to connect on LinkedIn from a LinkedIn member via email.
Session
li_giant
Indirect indentifier for groups of LinkedIn Members used for conversion tracking
7 days
sharebox-suggestion
Displays a banner that provides help text to first time users of the Elevate share box
Session
li_cc
Used to ensure a user's phone number is inputted in China
1 week
lss_bundle_viewer
Stores consent when a user agrees to view a Smartlinks link
1 month
interstitial_page_reg_oauth_url
Stores the referring page to ensure the Authentication screen displays correctly
1 day
df_ts
Device fingerprinting sampling for performance optimization
1 day
lil-lang
Stores user's selected language setting for LinkedIn Learning
Session
li_alerts
Used to track impressions of LinkedIn alerts, such as the Cookie Banner and to implement cool off periods for display of alerts
1 year
li_theme
Remembers a user's display preference/theme setting
6 months
li_feed_xray
Used to show new items in developer option 'Feed X-ray'
Session
VID
ID associated with a visitor to a LinkedIn microsite which is used to determine conversions for lead gen purposes
1 year
recent_history
Used to remember URLs visited by the guest to show the pages back where they left off
90 days
Marketing cookies are used to follow visitors to websites. The intention is to show ads that are relevant and engaging to the individual user.
Name
Description
Duration
affwp_campaign
Stores the affiliate campaign name for tracking purposes.
30 days
affwp_ref
Stores the referring affiliate ID for commission attribution.
30 days
affwp_ref_visit_id
Stores the visit ID linked to the referring affiliate.
30 days
LinkedIn Insight is a web analytics service that tracks and reports website traffic.