How To Add “Claim Entry” Functionality to Your Gravity Forms Directory Using Gravity Flow

How To Add “Claim Entry” Functionality to Your Gravity Forms Directory Using Gravity Flow

Written by Casey Burridge

Last updated:

Categories GravityView

Tags , ,

So you’re operating a directory built using GravityView, and now you need a way for users to claim ownership of entries?

For this type of functionality, Gravity Flow offers the perfect solution. Using Gravity Flow, we’ll create an approval workflow, allowing new users to take ownership of existing business listings.

This is helpful if you’re running a business directory and you want users to have control over their own profiles, including the ability to update information from the front end.

Keep reading to find out how GravityView and Gravity Flow work together to help you build powerful web apps with advanced workflows.

What You’ll Need

Here are the different plugins you’ll need if you want to follow along:

Sneak Peek

Here’s how the claim entry functionality will work. We’ll add a link on each directory listing allowing users to claim ownership of it (the link will only appear if the entry has not already been claimed).

A link that says 'Claim this entry' on a directory listing

When the user clicks “Claim this entry”, they will be taken to a page with a form on it allowing them to submit a claim for the entry. 

After submitting the form, a complex workflow will begin in order to approve the request and grant ownership of the entry to the user.

Introducing Gravity Flow

In this tutorial, we’re going to use Gravity Flow, a premium add-on for Gravity Forms. Gravity Flow allows you to create complex business processes and automations using Gravity Forms as a starting point.

Gravity Flow supports a wide variety of action steps, allowing you to create powerful processes involving approvals, notifications, assignments and more. 

First, You’ll Need a Directory

We’re not going to cover the creation of a business directory in this post. Instead, we’ll assume you already have a directory and you’re just looking to add “claim entry” functionality to it.

If you need help setting up a directory from scratch, read our tutorial on how to build a business directory with Gravity Forms.

A business directory built using GravityView

After building your directory, edit your directory listing form and add a new Radio Buttons field with the label “Has this entry been claimed?” and two options – “Yes” or “No”. Make sure this field is hidden and set the default value to “No”.

A Radio Buttons field labeled 'Has this entry been claimed?'

This will help us determine which entries have already been claimed so we know when to display the “claim entry” link. Now we can move on to the next step – creating the “claim entry” form.

Creating the “Claim Entry” Form

This is the form that will allow users to claim ownership of a specific entry. To create a new form, hover over Forms and click New Form.

Add the following fields to your form:

  • Name (Name field)
  • Email Address (Email field)
  • Business Name (Single Line Text field)
  • Business Entry ID (Number field)
  • Message (Paragraph field)

The Business Name and Business Entry ID fields will be dynamically populated. To set this up, click on the Business Name field, open the Advanced field settings, enable dynamic population and give it the parameter business-name.

A checkbox that says 'Allow field to be populated dynamically'

Now do the same thing for the Business Entry ID field but change the parameter to business-entry-id. You should also make this a hidden field so that it’s not visible to the user.

Parameter name: business-entry-id

Here’s what our form looks like on the front end:

The claim entry form

Creating the User Registration Feed

After creating the “claim entry” form and embedding it on a page on your website, it’s time to create the workflow that begins when a user submits the form. However, if your users don’t have accounts on your site, you’ll need to create a user registration feed first.

To do this, you’ll need to install the Gravity Forms User Registration add-on. Now go to the form settings for your “claim entry” form, click on “User Registration” on the left and select “Add New”.

The 'Add New' button on the User Registration feed

After giving your feed a name, select “Create User” as the action.

The 'Create User' action for the User Registration feed

After configuring the remaining settings, save the user registration feed.

Creating the Workflow

Now that you’ve created the claim entry form and set up the user registration feed, it’s time to build out the approval workflow using Gravity Flow. The finished workflow will consist of four steps. Here they are:

A four-step workflow built using Gravity Flow

Here’s a brief overview of each step:

  1. Approval – The claim entry request is sent to an administrator for approval.
  2. User Registration – If approved, an account is automatically created for the user.
  3. Update an entry – Here we’re updating the entry creator to the user who “claimed” the entry. We will also update a hidden form field to indicate the entry has already been claimed.
  4. Notification – An email to notify the new entry owner.

Step 1: Approval

The first step of the workflow in an Approval step. During this step, the entry claim request will be sent to a site administrator for assessment. If they think the request is just spam, they can deny it. If, however, they think the request is legitimate, they can approve it and trigger the next step in the workflow.

After giving the step a name, select “Approval” as the step type.

The 'Approval' step type

Now select the assignee as your website administrator.

Selecting an assignee for the approval step

You may also want to add a link to the entry in question. You can do this in the “instructions” by using an anchor link and some Gravity Forms merge tags.

Adding Gravity Forms merge tags inside the instructions box

Finally, you may want to enable the Assignee Email so that the assignee is notified when they have a new request to approve.

Step 2: Create User Account

The next step of the workflow is to run the user registration feed so that the user has an account on the site. In order to become the owner of an entry, the user will need to be logged in so this is an important step.

After creating the step, select “User Registration” as the step type.

The User Registration step type

Now choose the user registration feed you want to run.

A checkbox labeled 'Register new user'

That’s it!

Step 3: Update Entry Owner

In this step of the workflow, we’re going to change the owner of the directory entry to the user that claimed the entry.

After giving the step a name, select “Update an Entry” as the step type.

The 'Update an Entry' step type

Now you need to select the form with the entry you want to update (in this case, the “Business listings” form) and select the Entry ID field. 

Finally, under “Field”, there are two fields we need to update. The first is the “Created By” field and the second is the “Has this entry been claimed?” field.

Update entry settings in Gravity Flow

Now we can configure the final step of the workflow.

Step 4: Notify the New Owner

The final step is to send a notification email to the new entry owner, notifying them that the entry now belongs to them.

After naming the step, select “Notification” as the step type. 

The Notification step type

Now scroll down and enable the workflow notification. After that, select the Email Address field for sending the notification to.

Enabling the workflow notification

Finally, scroll down and update the notification email text.

The notification email text

That’s it!

Adding the Claim Entry Link

Now we need to add the “claim entry” link to our View. This will allow users to claim entries that belong to them.

The link should only be displayed if the “has this entry been claimed?” field is set to “No”. If the entry has already been claimed, the link should not appear. Luckily, this is easy to implement using the powerful shortcode.

The link itself should also include the parameters for the fields that need to be dynamically populated. 

To add the link to each entry in our View, we’ll add the following code to a Custom Content field.

The  shortcode inside the custom content field

Here’s what the link looks like on the front end:

The 'Claim this entry' link on a directory listing

That’s it! Now a user can click on this link and they’ll be taken to the claim entry form where they can submit a request for ownership of the entry. When they submit the form, the workflow we created with Gravity Flow will begin.

After the user has been granted ownership of the entry, they’ll be able to update it as they see fit.

Add a “Claim Entry” Link to Your GravityView Directory

If you’re operating a directory built using GravityView, you may need a way for users to claim ownership of entries. For this type of functionality, Gravity Flow offers the perfect solution!

In this tutorial, we showed you how to add a “claim entry” link to your GravityView directory using the powerful Gravity Flow add-on For Gravity Forms. If you found this post helpful, check out more articles from our blog!

Helpful tips right in your inbox.

Subscribe to our weekly newsletter for tips, special offers, and more!

Helpful tips right in your inbox.

Subscribe to our weekly newsletter for tips, special offers, and more!