Gravity Perks
Gravity Connect
Gravity Shop
Snippet Library
Blog
Account
Introducing Gravity Connect
•
Save up to 40% for a limited time with coupon
GCLAUNCH
•
Learn More
Gravity Wiz
Gravity Perks
Gravity Perks
A suite of 47+ Gravity Forms addons
Product Details
Pricing
Documentation
Gravity Connect
Gravity Connect
Connect Gravity Forms to top-shelf services
Product Details
Pricing
Documentation
Gravity Shop
Gravity Shop
Bridging Gravity Forms & WooCommerce
Product Details
Pricing
Documentation
Snippet Library
Blog
Account
Log In
Support
Menu
Snippets
Populate Anything
Snippet Library
/
Populate Anything
php
Convert ACF Date Into Gravity Forms Date
This snippet will format the value from a ACF Date field that is retrieved from the database and convert it...
php
ACF Repeater Mapper
Populate all rows from an ACF Repeater into a choice-based field.
php
Add A Custom Choice Template
Choice templates allow you to map data to different properties of your Gravity Forms choices. In this example, we demonstrate...
php
Add a Static Choice
php
Add Menu Order Property for Post Object
php
Add Term Order Property for Term Object
This snippet requires a plugin such as https://wordpress.org/plugins/taxonomy-terms-order/ which will add a new "term_order" column to the wp_terms table. Installation:...
php
Allow All Live Merge Tags for a Specific Form
php
Add Support for Aggregate Functions
Perform calculations on the values in a field/column and return a single value.
php
Case-sensitive Filter for Database Object Type
php
Auto-select Only Choice
If there is only one choice populated into a field, use this snippet to automatically select it.
php
Change “Fill Out Other Fields” Text
php
Change Query Limit for a Specific Field
php
Change No Choices Text
php
Change Query Limit for a Specific Object Type
php
Convert Arrays To A Comma Separated List
php
Support for Consent Field Description
php
Custom Database
By default, Populate Anything will only show the database that the current WordPress installation is on. The following snippet allows...
php
Custom GF_Entry Query Cache
This may improve performance but is known to return incorrect results when multiple fields are populated and chained to each...
js
Custom Field Refresh Trigger
php
Disable GFML gform_pre_render callback
Bypass processing forms with Gravity Forms Multilingual when pulling results for Populate Anything via AJAX. The reason for this is...
js
Disable All Fields
Disable fields on all forms when a GPPA query is active and its submit button is disabled.
php
Display Post Featured Image
Populate post featured image into an HTML field.
php
Dynamic Quantity Choices
Populate a dynamic number of choices for a Quantity field based on a populated value. For example, a canoe might...
php
Display Terms Hierarchically
Any field populated by GPPA with terms that belong to a hierarchical taxonomy will render these terms indented based on...
php
Explode Commas into Choices
Convert comma-delimited values into choices when populated into a choice-based field.
php
Convert Entry Date Created to Datepicker Format
Convert entry's "date_created" value from the database format (e.g. ISO 8601) to the datepicker format (e.g. m/d/Y) when populating into...
php
Explode Commas into Selected Choices
Convert comma-delimited values into selected choices when populated into a choice-based field.
php
Filter Results on Relative Dates
Filter results on relative dates with custom merge tags
php
Filter by Created By on Entry Edit
When filtering by the special Current User ID value, you may want to preserve the original context when editing an...
php
Filter Live Merge Tag Value by Container Field
The gppa_live_merge_tag_value provides a powerful method for filtering the value of a live merge tag but it does not allow...
php
Force Dynamic Population When Editing via GravityView
If you need to force repopulation when editing a child entry via GravityView, see:
php
Filter Terms by Depth
WordPress doesn't keep track of the depth of a term in a hierarchical taxonomy. This snippet allows you to filter...
php
Force Rehydration When Editing Entry
php
Disable Max String Length for Option Labels
php
Increase Max String Length of the Form Editor.
php
Format LMT as Bulleted List in RTE
Take a comma-delimited value (like that from a Multi Select field) and convert it into a bulleted list when it...
php
Format Live Merge Tag Depending on another field
Installation instructions: 1. https://gravitywiz.com/documentation/how-do-i-install-a-snippet/ 2. Update FORMID, FIELDID, and the $style_field_id variable accordingly. FIELDID should be the paragraph ...
php
Get Value Selected in Source Field When Populating Choices in Target Field
php
Format Numeric Choice Labels as Currency
php
Gravity Flow Form Connector: Populate Field on New Entry
Scenario: Form B creates a new entry in Form A via the Gravity Flow Form Connector. This snippet will populate...
js
Prevent Dynamic Checking of any disabled checkbox.
php
Force Rehydration on Edit
Use this snippet to force fields to be rehydrated via Populate Anything when they are rendered in the Entry Blocks...
php
Handle New Lines
Replace the \n new line terminator with an actual new line in template values. This is particularly useful in custom...
php
Force Dynamic Population When Editing a Child Entry via GravityView
php
Hide Post And Taxonomy Term as Population Options
php
Ignore Empty Save & Continue Values
By default, Populate Anything will honor empty values saved for a field via Save & Continue. Use this snippet if...
php
Ignore Current User Filter for Administrators
If you've configured a filter based on the "Current User ID" option and wish to ignore that filter for administrators,...
php
Ignore Save & Continue Value
php
Ignore Required Validation for Fields w/ No Results
php
Include Static Choices
Include static choices alongside your dynamic choices populated by Populate Anything.
php
JetEngine Repeater Mapper
Populate all rows from a JetEngine Repeater into a choice-based field.
php
Change The Query Limit
js
Listen for Populate Anything Updates on a Specific Field
php
List Selected Posts in HTML Field
When populating a Multi Select field with posts and allowing the user to select posts they're interested in, this snippet...
php
Add Line Break Between Live Merge Tag Checkbox Values
php
Extract Domain from Email Address
php
Diff Modifier for Live Merge Tags
Use the :diff modifier with Date field merge tags to get the difference between the user-selected date and a static...
php
Live Merge Tag Modifier: img
Use the "img" modifier to output an image, rather than the merge tag's default output. For example, here is a...
php
Populate Gravity PDF URL via Live Merge Tag
Use this snippet to convert an entry ID value from one field to a Gravity PDF URL for population in...
php
Output List Field as Rows
php
Replace Merge Tags in Specific Context
This snippet allows you to replace a merge tag in the context of an entry selected in a GPPA-populated field.
php
Add Live Merge Tag to Whitelist
php
Modify Max Properties Displayed in Editor
Modify the max number of property values that can be displayed in a property value select in the Form Editor...
php
Use Standard Merge Tags in Choice/Value Templates
php
Modify Template Value
php
Add Multiple Custom Fields as Choices
Use this snippet to dynamically populate a field with multiple custom field values. For example, imagine you have a booking...
php
Search by Multiple Values w/ Contains
This snippet extends the "contains" operator to support comparisions where a multi-value field (like a Multi Select) is the needle....
php
Populate Notification as Choices & Send on Submission
Populate notifications available for a selected entry and send the selected notification when the form is submitted.
php
Parse Shortcodes in Choice Labels
php
Add Object to Live Merge Tag Modifier
Add support for an :object modifier to output a different property of the selected object. Example: @{:2:object[post_content]}
php
Populate Choice-based ACF Field as Choices
Use Populate Anything's field settings to map a choice-based ACF field to a Gravity Forms choice-based field (e.g. Drop Down,...
php
Performant Unique Results (for Database Object Type)
Populate Anything limits its queries to the first 500 results for performance. When using the "Only Show Unique Results" setting,...
php
Populate ACF Relationships
Populate each related post as a separate choice when populating data from an ACF Relationship custom field.
php
Populate All Results
By default, when populating a field's value, Populate Anything will only populate the first found result. This snippet adds support...
php
Populate Checkboxes (and Multi Selects) as Choices
When populating data from a Checkbox or Multi Select field via the Gravity Forms Entry object type, all selected values...
php
Populate Form Fields as Choices
Convert a form ID populated into a choice-based field into a list of fields that belong to that form. This...
php
Populate Child Entries
A brief description about this snippet and the functionality it provides. Might also include basic usage instructions if applicable.
php
Populate Multi-file Upload Images as Separate Choices
Populate a preview of each image uploaded into a Multi-file Upload field as a separate choice in a Radio or...
php
Populate Entries from Multiple Forms
Filter and populate desired entry IDs by using the Populate Anything Database object type. Populate the choice label with the...
php
Return Column Name of Matching Value
When populating a field with multiple "or" filter groups, use this snippet to populate the column name of the matching...
php
Populate Unique Results Count
php
Populate Values in REST API Request
Populates dynamically populated values if a value is not explicitly provided for fields that have values populated by Populate Anything.
php
gppa-postmeta-property-value-limit.php
php
Use Post Meta Date Picker Fields for Comparison
Cast dates saved by Advanced Custom Fields or Pods into dates that are comparable using MySQL queries.
php
Preserve Field Selections on Repopulation
php
Relax Template Cache To Not Include Field ID
js
Refresh Field on Form B when Form A is Submitted
php
Remove Default Behavior of Using a Comma as a Delimiter
js
Remove Empty Choices
Install this snippet with our free Custom JavaScript plugin. https://gravitywiz.com/gravity-forms-code-chest/
php
Remove Hidden Non-breaking Spaces
Remove hidden non-breaking spaces from your field values. This snippet currently only applies to multi-selectable choice fields (e.g. Checkboxes, Multi-selects)...
php
Remove Empty Label Segments by Delimiter
Let's say you have a Populate-Anything-populated field that has a Custom Value template configured like this: {post:post_title} - {post:post_excerpt} This...
php
Remove Spaces from Comma-delimited Values
js
Replace Live Merge Tags Individually and Show Spinner
Install this snippet with our free Custom JavaScript plugin. https://gravitywiz.com/gravity-forms-code-chest/
js
Replace Field with Spinner Instead of Pulsing
Install this snippet with our free Custom JavaScript plugin. https://gravitywiz.com/gravity-forms-code-chest/
js
Require a Minimum Character Count Before Triggering a Change
Install this snippet with our free Custom JavaScript plugin. https://gravitywiz.com/gravity-forms-code-chest/
php
Auto-update Form ID on Form Duplication
Auto-update form ID to the new form ID when duplicating an existing form.
js
Default the First Populated Choice for Radio having choices populated with GPPA
Install this snippet with our free Custom JavaScript plugin. https://gravitywiz.com/gravity-forms-code-chest/
php
Set Template by Field Value
I'll take another stab at explaining this another day. For now, watch the instructional video above. 😅
php
Set Post Taxonomy Terms
When the Term ID is set as the value of a dynamically populated choice-based, this snippet allows you update the...
js
Slow Down Keyup Listener
Currently all events are triggered on a 250ms debounce. Use this snippet to slow down keyup triggers so users have...
php
Strip slashes from result choices
php
Split New Lines into Choices
Split new lines into separate choices when populating from Paragraph fields (or any other value that may contain new lines).
php
Strip slashes from result values
js
Trigger Population on Button Click
Instead of automatically populating fields when an input is changed, trigger the population when a button is clicked.
php
Strip Tags from Populated Value
php
Unserialize as Choices
Convert serialized data into choices when populated into a choice-based field.
php
Populate choices using choice labels rather than values
php
Use Advanced Custom Field’s Choice Label
By default, Populate Anything will populate the value of any choice-based ACF custom field that is mapped. This snippet allows...
js
Wait for Population Before Submitting When Enter Key Pressed
By default, the form is immediately submitted after the Enter key is pressed. This means if the field triggers dynamic...
php
Use Newline As The Delimiter for Paragraph Text fields
php
Use Choice Labels for Zapier
Use choice labels instead of choice values for data sent to Zapier when field's choices are populated by Populate Anything.