TutorialBulk Update Gravity Forms Entries

Do you want to bulk update a large batch of Gravity Forms Entries? For example: You need to replace a piece of text in a particular field value. But not in just one entry, but in 12321 entries! A nearly undoable task by hand, but updating that much entries is a breeze with our Update Multiple Entries add-on. And Advanced Merge Tags will do the search and replace for you. Let me show you how to do it.

1.Creating a form to trigger the bulk update

The Update Multiple Entries Addon provides a new type of feed for Gravity Forms, which can be used to trigger updates in the entries of a target form. So, to mass update a large batch of entries we need to create a ‘trigger’ form with one text field which we label description:

Screenshot - Creating a new form named 'Trigger Form - Update Multiple Entries'
Create a new form named ‘Trigger Form – Update Multiple Entries’
Screenshot - Add a text field
Add just one field

2. Adding the Update Multiple Entries Feed

Then go to the Settings page of your new trigger form and select the ‘Update Entries’ tab:

Click ‘Add New’ to add a new Update Multiple Entries Feed. This will open the Feed Settings of your new feed.

Screenshot - Create a new Update Multiple Entries Feed
Create a new Update Multiple Entries Feed

In this example we want to replace the word ‘dog’ by ‘cat’ in all the entries in the target form. So let’s do it like this:

  • Enter the name of the Feed, like “Search and replace ‘dog’ “.
  • Select the target form which entries you want to update.
  • We narrow down the batch of entries to be updated to entries which have the word ‘dog’ in the value, by configuring the Target Entry Conditions by adding the rule: ‘Just a Text Field’ contains ‘dog’. This wil only update entries which have the word ‘dog’ in a textfield value, skipping other entries.
  • In the Field Mapping we target the ”Just a Text Field’ -field and set the value it to a custom value so we are able to use Merge Tags. In this case we want to modify a value from the target entry, so we use the special target Merge Tag to get the targets entry field value: {target:1}.
  • But we don’t want the actual value, but the value with ‘dog’ replaced by ‘cat’. So we use a special Merge Tag Modifier: gwp_replace: {target:1:gwp_replace search=”dog” replace=”cat”}
Screenshot - The Update Multiple Entries Feed settings for this example.
The Update Multiple Entries Feed settings for this example.

Now everything is ready!

3. Triggering the bulk update of multiple entries

Open the trigger form in preview mode, enter something in the Description and hit Submit:

Screenshot - Submit the trigger form.
Submit the trigger form

4. Result of the bulk entry update

Before the update there were 12321 entries with ‘I love my dog!’ in the target form:

Screenshot - Entries in the target form before the bulk update.
Entries in the target form before the bulk update.

Below is the entry in the trigger form which executed the Update Multiple Entries Feed as we configured it. As you can see it executed te update of 25 entries to determine the server speed. The rest of the entries were updated in 12 chunks to prevent crossing the PHP execution time limit (30 seconds on most servers). These chunks run in a background process.

Screenshot - The Entry in the trigger form, showing notes about the Update Entries Feed results.
The Entry in the trigger form.

After around 3 minutes the Update Multiple Entries feed has updated every entry of the 12321 entries. Of course the speed can be faster or slower depending on the server.

Screenshot - Entries in the target form after the bulk update.
Entries in the target form after the bulk update.

Read more tutorials about GravityWP BV

GravityWP develops add-ons to collect and manage your data better.
All tutorials GravityWP BV