| CARVIEW |
Select Language
HTTP/2 301
date: Sat, 27 Dec 2025 10:30:49 GMT
content-type: text/html; charset=UTF-8
location: https://docs.gravityforms.com/gform_rule_source_value/
server: cloudflare
strict-transport-security: max-age=604800
strict-transport-security: max-age=31536000; includeSubDomains
x-content-type-options: nosniff
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
x-frame-options: SAMEORIGIN
content-security-policy: frame-ancestors 'self';
referrer-policy: no-referrer
referrer-policy: strict-origin-when-cross-origin
x-redirect-by: WordPress
fastcgi-cache: MISS
cf-cache-status: DYNAMIC
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=PW06lQJ15ysk1xeZ0gelbrXozJFLwaLpl3reJvQDeUEG4icwgqvNh%2BUTpZVo7q3BXX6NbVtiB2XOC%2BTE2rQ7okYiN6zqv13IhgSn02mgxv562O%2F%2B"}]}
cf-ray: 9b48250e8b9d9dfa-BLR
HTTP/2 200
date: Sat, 27 Dec 2025 10:30:50 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
vary: Accept-Encoding
strict-transport-security: max-age=604800
strict-transport-security: max-age=31536000; includeSubDomains
x-content-type-options: nosniff
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
x-frame-options: SAMEORIGIN
content-security-policy: frame-ancestors 'self';
referrer-policy: no-referrer
referrer-policy: strict-origin-when-cross-origin
link: ; rel="https://api.w.org/"
link: ; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
fastcgi-cache: HIT
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=oLrtUbX1EvfuAchUJM4YilFwcI%2Bjqb%2BOy2KZvgF%2BjBXksQ%2FPNnR22aJTFvI%2F08GYbiHSf1cM3POPEc5GGKtqupRqj4Zkg%2B68VbusxiyLropkSrht"}]}
cf-cache-status: DYNAMIC
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
content-encoding: gzip
cf-ray: 9b4825117fc39dfa-BLR
gform_rule_source_value - Gravity Forms Documentation
gform_rule_source_value
Description
Filter the source value of a conditional logic rule before it is compared with the target value.
Usage
add_filter( 'gform_rule_source_value',function( $source_value, $rule, $form, $logic, $entry ) {
// Modify the rule
return $source_value;
}, 10, 5 );
Parameters
- $source_value int|string
The value of the rule’s configured field ID, entry meta, or custom property.
- $rule Rule Object
The current rule object. See the Rule Properties section of the Conditional Logic Object article.
- $form Form Object
The current form meta.
- $logic Conditional Logic Object
All details required to evaluate an objects conditional logic.
- $entry Entry Object
The entry currently being processed, if available.
Example
add_filter( 'gform_rule_source_value', function( $source_value, $rule, $form, $logic, $entry ) {
// Changing the field value when evaludating conditional logic with source field id 3, and form id 1.
if ( $form['id'] == '1' && $rule['fieldId'] == '3' ) {
$source_value = 'my custom field value';
}
return $source_value;
}, 10, 5 );
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Since
This filter was added in Gravity Forms v2.6.2.
Source Code
This filter is located in GFFormsModel::evaluate_conditional_logic() in forms_model.php