bugfix/FOUR-27646 First Financial Bank - Validation Rules for Hidden Required Fields Inside Loops Are Inconsistently Applied#1913
Open
gustavobascope wants to merge 1 commit into
Open
Conversation
screen-builder
|
||||||||||||||||||||||||||||||||||||||||
| Project |
screen-builder
|
| Branch Review |
bugfix/FOUR-27646
|
| Run status |
|
| Run duration | 09m 51s |
| Commit |
|
| Committer | gustavobascope |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
2
|
|
|
0
|
|
|
19
|
|
|
8
|
|
|
379
|
| View all changes introduced in this branch ↗︎ | |
Tests for review

WatchersDragAndDrop.spec.js • 1 failed test • CI - Chrome
| Test | Artifacts | |
|---|---|---|
| Watchers list Drag&Drop > should drag and drop first row to third row |
Test Replay
Screenshots
|
|

ValidationRulesAdvanced.spec.js • 1 failed test • CI - Chrome
| Test | Artifacts | |
|---|---|---|
| Validation Rules (Advanced test) > Verify all validation rules within loops |
Test Replay
Screenshots
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue & Reproduction Steps
First Financial Bank - Validation Rules for Hidden Required Fields Inside Loops Are Inconsistently Applied
Expected behavior:
Hidden required fields should not be validated.
Validation should only apply to inputs that are visible and active at the time of submission.
Actual behavior:
When the screen loads, all three loop instances are created (because the default count is 3).
Even if the input fields are hidden (checkbox unchecked), the system still tries to validate them.
As a result:
Clicking Submit triggers “The field is required” errors for all hidden inputs.
If you check only the second or third checkbox and fill that input, the hidden ones still fail validation.
If you check and fill only the first input, the form submits successfully — even though the others remain hidden and empty.
This makes validation inconsistent depending on which iteration is visible or filled.
Solution
Added isVisible and insideLoop validation

How to Test
Create a new screen.
Add a Loop container loop_1.
Set Default Loop Count: 3
Inside loop_1, add:
A Checkbox form_checkbox_1.
A Required Line Input form_input_1.
For the Visibility Rule of form_input_1, set:
form_checkbox_1
(so the input only appears when the checkbox is checked).
Add a Submit button outside the loop.
In Preview mode:
Leave all checkboxes unchecked
Click Submit → all hidden required fields fail validation.
Check only the second or third checkbox and fill the input → hidden instances still fail validation.
Check and fill only the first instance → submission succeeds, even if other hidden fields exist.
Related Tickets & Packages
https://processmaker.atlassian.net/browse/FOUR-27646