Creating a leaderboard with GravityView
Sort a View by a Number field from highest to lowest, and its entries line up as a leaderboard. The example below ranks the sales associates of a costume shop by their sales this month.

Note: GravityMath’s Math Summary widget shows calculations for a field in a table. See How to display summaries using a block, widget, or shortcode.
Step 1: Create a View #
- Go to GravityKit, then click New View.
- Enter a name for the View, such as
Sales leaderboard.

Step 2: Choose the form and the View type #
- Under Data Source, choose the form that holds the numbers to rank. The example uses a form called Monthly Sales Tracker.
- Under Choose a View Type, hover over Table and click Select.

To use DataTables Table instead, see Using the DataTables Table layout below.
Step 3: Add the columns #
After you choose Table, the View editor fills the Multiple Entries Layout tab with columns from the form’s first fields. To pick your own:
- Under Visible Table Columns, click Clear all fields and confirm.
- Click Add Table Column and choose a field. Repeat for each column, and include the Number field that holds the score.

To show each entry’s place in the ranking:
- Click Add Table Column and choose Result Number. It numbers the rows 1, 2, 3 in the order they are shown.
- Click the gear icon on the Result Number column.
- Under Custom Label, enter a heading for the column, such as
Rank.

The score can be a Number field that people fill in, or one that Gravity Forms works out with Enable Calculation. A Number field with the Currency format sorts as a number too. In the example, Sales total is a Number field with the Currency format, calculated from the costumes and accessories sold.

Step 4: Sort by the score #
- In the Settings box below the layout, click the Filter & Sort tab.
- Under Sort by field, choose the Number field.
- Under Sort direction, choose Descending, so the highest number comes first.

Step 5: Show only the top entries (optional) #
For a top 10 list:
- In the Settings box, click the Multiple Entries tab and enter
10in Number of entries per page. - On the Multiple Entries Layout tab, click the remove icon on each Page Links widget, under Top Widgets and under Bottom Widgets.
- Remove Show Pagination Info and the Search Bar the same way if the leaderboard doesn’t need them.


The number sets the size of one page. Entries 11 and up are still on page 2, and without Page Links visitors have no link to it.
Step 6: Publish the leaderboard #
Click Publish.

The leaderboard now has its own address on your site. To show it on a page, see Embedding a View on a page or post.
New Views show only approved entries, because Show only approved entries in the View Settings tab is on. A new submission joins the leaderboard once it is approved, and visitors see it the next time they load the page. To approve entries, see Managing entry approval in the Gravity Forms Entries screen.
Using the DataTables Table layout #
DataTables is built into GravityView Pro. To turn it on or off, go to Plugins and click Features in the GravityView Pro row.
Choose DataTables Table in Step 2 and the table keeps your sort order. It also adds its own controls: a Show entries menu, a search box, page links and export buttons.
Visitors can sort by any column and page through every entry, so your top 10 is only the first page. Result Number counts the rows in the order they are on screen, so after a visitor sorts by another column, the numbers follow the new order. To set up the layout, see Getting started with the DataTables Layout.
For more ideas, read How to create a leaderboard on your WordPress site on the GravityKit blog.