How does validationGroup work?

This should be a simple topic but I haven't been able to completely figure out how does the validationGroup work. For example, let's say I have a form with two sections. On the first section I have two fields and a buttonWidget. In another form I have two other fields with another button. The fields on the first section I have them as required=true but the fields on the second section are NOT required. If I leave the fields on the first section blank and I click on the button from the SECOND section, the validations will kick off on the first section. I DONT want this to happen. I want the sections to be independent. I tried adding validationGroup to the button and respective fields and the red * from the required fields are gone. Why are they gone when I add validationGroup? How can I make the buttons be independent for their given sections?

Why something so simple like this seems to be more complicated? Am I making it more complicated than what it actual...

OriginalPostID-205318

OriginalPostID-205318

  Discussion posts and replies are publicly visible

  • ...ly is? I have read the documentation and haven't found anything that answer my questions.
  • Hi Erickp
    That's an expected behavoir.
    Though the * mark doesn't appear, the validations will work properly when the buttons are clicked.
    When we add a validation group to the buttons, the custom validations work and as a result the default Appian provided feature of * mark for required fields doesn't appear.
    We can achieve the independent behavior of sections, through the usage of validation group
  • Hello erickp, In the beginning when I don’t know the proper use of validation group I also thought like why * mart is not showing for labels when make the filed as required. But later I under stood that, it was not a good way to show * mart when the field is required only on certain conditions. So if you provide validation group for any fields in the form or section then it will not show any * mark for those field labels but it will validate them when you click on the button which is related to that validation group.
  • Hi Eric,

    As told by other practitioners in the above posts, it is correct that the * mark goes off when you add that particular component into the validation group of any button.

    However to make the buttons independent for their given sections, you can use different validation groups for both the buttons. For example, place all the components (buttons and the two fields) of the first section in one validation group, let's say "VAL1" and place all the components of the second section into another validation group like "VAL2".

    In this way, when you will click the first button (of the first section), only the fields belonging to the first section will be validated. Same goes for the second section, its fields will only be validated on the click of second button.

    Hope, this resolution satisfies your use case!