Listing entries assigned to a specific user

Make sure to check out this course on GravityKit Academy on Advanced User Management and CRM Functionality, which covers a similar use case to this article.

If you are using Gravity Flow's Assignee field, then please check this other article instead.

It's pretty easy to only display entries created by the currently logged-in user in GravityView by using the Advanced Filtering Extension.

But what if you want to display entries assigned to the currently logged-in user who did not create the entries?

In this short tutorial, we'll show you how to add a drop-down field to your form that lists all your WordPress users, and then use it to "assign" an entry to another user. We'll create a simple form to assign tasks to other users.

Prefer to watch the video?

Step 1: Preparing your form

Your form needs a drop-down field that dynamically populates with your WordPress users. To do this, we'll use our free Gravity Forms Dynamic Lookup add-on.

The Gravity Forms Dynamic Lookup add-on lets you populate Gravity Forms drop-down, radio button, and checkbox fields with dynamic data from your WordPress site, such as users, posts, or other form entries. In this case, we're using it to populate the "Assign to" field with a list of WordPress users, where each option's label is the user's display name and its value is their user ID.

In our example, the form has the following fields:

  • A Priority drop-down field
  • A Notes paragraph field
  • An "Assign to" drop-down field, dynamically populated with WordPress users

If we preview the form, the "Assign to" drop-down is automatically populated with the existing WordPress users.

A Gravity Forms form on the front end showing Priority, Notes, and Assign to fields. The Assign to dropdown is open, listing WordPress users: Alice Smith (selected), casey, Dave Hanley, Lara Smith, and Lawrence Carter.

Save your form and submit some test entries, assigning them to different WordPress users.

Step 2: Filtering the View by the logged-in user

After creating a View, open the View settings and click on the Filter & Sort tab. Add a new advanced filter condition and set the field to Assign to.  Then set the operator to is and select Currently Logged-in User from the value dropdown.

The Advanced Filter settings panel in GravityView. A filter condition is set to

The "Currently Logged-in User" option automatically matches the logged-in user's ID against the value stored in the "Assign to" field. There's also a "Currently Logged-in User (Disabled for Administrators)" option, which allows admins to see all entries regardless of assignment.

Your completed filter should look like this:

The Advanced Filter settings panel in GravityView with a completed filter condition:

Now, when a user views this View on the front end, they will only see entries that have been assigned to them.

For more advanced filtering options, read the article about the {user} Merge Tag, which can be used to retrieve any data from the currently logged-in user, including custom user meta.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us