In this new series, we’ll be looking at features of GravityView and the awesome things you can do with them. In our first post, we’ll look at the many ways you can sort, feature and filter your entries. Let’s get started!
Filtering and Sorting: The Where and How
What do filtering and sorting mean in GravityView? It’s simple:
- Filtering lets you choose which entries will appear in your View, according to parameters that you set. For example, you can only show entries that were added after a certain date. Entries that don’t fit your criteria will be filtered out.
- Sorting lets you reorganize how your entries will be displayed in the View. For example, you can choose to have your entries sorted by the Last Name field.
The bulk of the filtering and sorting options are available in the GravityView default options panel at the bottom of the View page, under Filter & Sort. To use the more advanced filtering options, you’ll need the Advanced Filtering extension.
Let’s go through each option and see what you can do with it!
If this option is enabled, a tiny arrow will appear at the top of all your columns. If you click the arrow, the entries will be sorted by that field. For example, if you clicked on Industry, the entries will be sorted by that field.
Sort by Field
This lets you choose the field by which the entries are sorted. If you are creating a staff directory, for example, you’d probably want to select the Last field. That way, your staff members will be sorted by their last name.
This option lets you choose how your entries will be listed.
- ASC (Ascending): From A to Z, or lower numbers to higher numbers.
- DESC (Descending): From Z to A, or higher numbers to lower numbers. This is useful if you want to display a list of numbers from large to small.
- Random: In a random order. Note that this order will be randomly generated every time the View is reloaded.
Filter by Start Date and Filter by End Date
These two options let you only display entries that adhere to certain dates. You can either select a specific date, like 4 February 2019, or you can use relative dates, like one week ago. Read the full list of relative dates here.
Filter by Start Date
If you enter a date here, entries will only be displayed if they were submitted on or after this date. For example, if you input January 1, 2019, entries will only be displayed in your View if they were created on or after January 1, 2019.
Filter by End Date
This is the opposite of Filter by Start Date. If you enter a date here, entries will only be displayed if they were submitted before the date. For example, if you input January 1, 2019, entries will only be displayed in your View if they were created before January 1.
Finally, let’s talk about the Advanced Filter options. You can create incredibly powerful filters by adding multiple unique conditions. You can add as many filters as you like. This is very useful if you want to create Views that have very specific purposes. To add a filter, just click the Add a Condition button.
For example, you may want to create a View that only displays entries that have the answer Yes for the Payment Status field.
Or, if you are building a university student directory, you may want to only display entries that have the answer 2019 for the Graduation Year field. The options available for each field depend on what type of field it is. The possibilities are endless!
One of the most common real-world uses for this filter is to limit the entries displayed to those created by the current user. For example, you may want to create a View that displays all the items a user added to the database. To do this, add a new filter and select Created by + is + Currently Logged in.
Also note that any search results within the View will also be filtered through these rules. So, don’t worry – the user won’t be able to access the data via a search.
If you want to only show entries from the current day, week, or month, check out this guide.
There are also some other ways to sort and highlight your entries.
Sort Your Entries Alphabetically
Want to organize your entires alphabetically? With our A-Z Filters extension, it’s easy to create an alphabetized directory. You can choose which field to filter by, which alphabet to use (over 26 languages are supported), and if you want the letters to be capitalized or lower case.
This is perfect for staff directories or student databases. Simply select the Last Name filter as the filter by selection.
Highlight Certain Entries
Do you have certain entries that are special or should stand out? With the Featured Entries extension, you can promote them!
To make an entry featured, simply click the star next to your entry on the Forms > Entries page.
By default, featured entries will be highlighted but still listed in the standard order. But, what if you want your Featured Entries to the top of the listed results? It only takes one click – go to the settings panel at the bottom of your View. Under View Settings, scroll to the bottom and check the Move Featured Entries to Top option. Voila!
If you’re running a paid directory or job board, the Featured Entries extension is perfect for you. You can easily charge your customers to make their entries featured + listed at the top of the View.