Conditional Logic [Pro]
How It Works
GF Repeater supports Gravity Forms’ native conditional logic inside repeater groups. Each row’s conditional logic is evaluated independently.
Architecture
- CL data is captured from repeater fields before rendering (priority 5)
- CL is stripped from fields so GF doesn’t apply it globally (priority 10)
- Captured data is output as
window.gfrRepeatCLDatain the page footer - JS module evaluates rules per-row using the captured data
Example
Repeater group for team members:
- Role (dropdown): Developer, Designer, Manager
- GitHub Username (text): visible when Role = Developer
- Portfolio URL (text): visible when Role = Designer
Row 1 selects “Developer” — GitHub field appears. Row 2 selects “Designer” — Portfolio field appears. Independent per row.
Server-Side Evaluation
During validation and sticky row rendering, CL is evaluated server-side. Hidden fields are:
- Not validated for that row
- Not saved for that row
Supported operators: is, isnot, >, <, contains, starts_with, ends_with
Logic types: all (AND), any (OR)
Client-Side Evaluation
The JS module fires on:
onRowAdded— apply rules to new rowonFieldChanged— re-evaluate when values changeonStickyRowsReady— apply to server-rendered rows
For sticky rows, values are read from the data-row-values attribute (JSON).
Limitations
Fields referenced in conditions must be within the same group. Cross-group CL is not supported.
Using Row Count in CL
The Conditional Row Limits module injects a hidden input tracking the row count. This lets you use GF’s standard CL rules outside the repeater — e.g., show a summary only when 3+ rows exist.
Custom Visibility Override
add_filter( 'gfr_is_field_hidden', function( $hidden, $field, $form, $row_values ) {
if ( (int) $field->id === 5 ) return false; // always show
return $hidden;
}, 10, 4 );