253
Views
5
Comments
Solved
What do you mean by this (Form Validation) ?!
Question

Currently I'm learning about Form Validation and in OutSystems' lesson it describes this statement, 

" The valid property of the Form is automatically set to False, when at least one input field of the Form is set to not valid. This property cannot be explicitly changed in the logic, and is managed automatically by the platform (e.g= Assign)

I understand everything in lesson except this statement " ... This property cannot be explicitly changed in the logic, and is managed automatically by the platform." 

What does it mean by "the valid property cannot be explicitly changed in the logic?" , and why

"Assign" is e.g.? 

One of my mates explained, it means the Form1.Valid's "If" cannot be changed ,for example, to "Assign"  or something but I don't that is it since it states "the Valid property ..." and how do you mean by "cannot be EXPLICITLY changed." ? 

How do you interpret the phrase "explicitly changed" in general? Does it mean as if some image itself cannot be changed? 


form val quest.PNG
2021-09-06 15-09-53
Dorine Boudry
 
MVP
Solution

Hi S H Kim,

it means you can not change the value in your code, and a typical way that would be done is in an Assign.  You can only check it's value (for example in an If widget)

So it can not EXPLICITLY be changed, but only IMPLICITLY, by changing the valid property of one of the inputs that are part of the form.  This happens by the built-in validations under water, or by your own assign of the valid property of one of the inputs.  

so if you find the word explicit hard to understand in this context, you could read is as : it cannot DIRECTLY be changed, but only INDIRECTLY by changing the valid property of one of the inputs.

Or yet another way of thinking, is that the valid property of a form is a derived value of the valid properties of all inputs on the form.

Dorine

UserImage.jpg
SeungHwan Kim

Thank you very much for your answer.

But I still don't fully get it since I'm a beginner and a little confused.

Do you mean, in an Assign there is [variable = value] so you can change like [xxx_input = True or False] but in Form Validation If widget you can't set the value of the Valid property?  

So, it has nothing to do with [Form.Valid If Widget] itself that appears in the default logic flow on an Screen Action Flow, "The Form.Valid cannot be explicity changed" is a statement that just explaining the general fact of an If widget? 


Could you provide an explanation with an example or a scenario? 

I sort of get the abstract understanding of your answer but I want to make sure that I'm fully acknowledged. 

Thank you

2021-09-06 15-09-53
Dorine Boudry
 
MVP

it is the form.valid that is a read-only property for us as developers, meaning that you can't use an assign to change it's value.

The platform keeps it in sync with the valid properties of all the input widgets on it.  An input widget can get a valid = false automatically by the built-in validations, or you can Assign false to it if you perform custom validations in your flow.

Any time that in the built-in or your custom validations, one of the inputs get a valid = false, the form will also get a valid = false.

Dorine

2021-09-06 15-09-53
Dorine Boudry
 
MVP
Solution

Ah, and as for an example, let's say you have a mandatory firstname and lastname input on your form, and you want lastname to be at least 3 characters.

scenario 1:

  • the user only fills the lastname as XX
  • the user clicks save button
  • all the valid properties are reset to true
  • built-in validations detect an empty first name, set the first name valid = false and set firstname.validationmessage, at this point the form.valid is already false
  • your custom validations run to check lenght of lastname, you set lastname.valid = false, and an appropriate lastname.validationmessage
  • Now the If form.valid is checked, and the false branch is followed

scenario 2:

  • the user fixes the firstname, fills the lastname as AB
  • the user clicks save button
  • all the valid properties are reset to true
  • built-in validations are happy as both mandatory fields are filled, at this point form.valid is still true
  • your custom validations run to check lenght of lastname, you set lastname.valid = false, and an appropriate lastname.validationmessage, at this point form.valid becomes false
  • Now the If form.valid is checked, and the false branch is followed

scenario 3:

  • the user now also fixes the lastname as ABC
  • the user clicks save button
  • all the valid properties are reset to true
  • built-in validations are happy as both mandatory fields are filled, at this point form.valid is still true
  • your custom validations run to check lenght of lastname, this is ok, so no lastname.valid is changed to false, and the form.valid is still true
  • Now the If form.valid is checked, and the true branch is followed

Dorine

UserImage.jpg
SeungHwan Kim

You are the best Dorine. 

I'm deeply thankful to your answer. 

You helped me tremendously with my presentation at work. 

Thank you very much !

2021-09-06 15-09-53
Dorine Boudry
 
MVP
Solution

Ah, and as for an example, let's say you have a mandatory firstname and lastname input on your form, and you want lastname to be at least 3 characters.

scenario 1:

  • the user only fills the lastname as XX
  • the user clicks save button
  • all the valid properties are reset to true
  • built-in validations detect an empty first name, set the first name valid = false and set firstname.validationmessage, at this point the form.valid is already false
  • your custom validations run to check lenght of lastname, you set lastname.valid = false, and an appropriate lastname.validationmessage
  • Now the If form.valid is checked, and the false branch is followed

scenario 2:

  • the user fixes the firstname, fills the lastname as AB
  • the user clicks save button
  • all the valid properties are reset to true
  • built-in validations are happy as both mandatory fields are filled, at this point form.valid is still true
  • your custom validations run to check lenght of lastname, you set lastname.valid = false, and an appropriate lastname.validationmessage, at this point form.valid becomes false
  • Now the If form.valid is checked, and the false branch is followed

scenario 3:

  • the user now also fixes the lastname as ABC
  • the user clicks save button
  • all the valid properties are reset to true
  • built-in validations are happy as both mandatory fields are filled, at this point form.valid is still true
  • your custom validations run to check lenght of lastname, this is ok, so no lastname.valid is changed to false, and the form.valid is still true
  • Now the If form.valid is checked, and the true branch is followed

Dorine

2021-09-06 15-09-53
Dorine Boudry
 
MVP
Solution

Hi S H Kim,

it means you can not change the value in your code, and a typical way that would be done is in an Assign.  You can only check it's value (for example in an If widget)

So it can not EXPLICITLY be changed, but only IMPLICITLY, by changing the valid property of one of the inputs that are part of the form.  This happens by the built-in validations under water, or by your own assign of the valid property of one of the inputs.  

so if you find the word explicit hard to understand in this context, you could read is as : it cannot DIRECTLY be changed, but only INDIRECTLY by changing the valid property of one of the inputs.

Or yet another way of thinking, is that the valid property of a form is a derived value of the valid properties of all inputs on the form.

Dorine

UserImage.jpg
SeungHwan Kim

Thank you very much for your answer.

But I still don't fully get it since I'm a beginner and a little confused.

Do you mean, in an Assign there is [variable = value] so you can change like [xxx_input = True or False] but in Form Validation If widget you can't set the value of the Valid property?  

So, it has nothing to do with [Form.Valid If Widget] itself that appears in the default logic flow on an Screen Action Flow, "The Form.Valid cannot be explicity changed" is a statement that just explaining the general fact of an If widget? 


Could you provide an explanation with an example or a scenario? 

I sort of get the abstract understanding of your answer but I want to make sure that I'm fully acknowledged. 

Thank you

2021-09-06 15-09-53
Dorine Boudry
 
MVP

it is the form.valid that is a read-only property for us as developers, meaning that you can't use an assign to change it's value.

The platform keeps it in sync with the valid properties of all the input widgets on it.  An input widget can get a valid = false automatically by the built-in validations, or you can Assign false to it if you perform custom validations in your flow.

Any time that in the built-in or your custom validations, one of the inputs get a valid = false, the form will also get a valid = false.

Dorine

2021-09-06 15-09-53
Dorine Boudry
 
MVP
Solution

Ah, and as for an example, let's say you have a mandatory firstname and lastname input on your form, and you want lastname to be at least 3 characters.

scenario 1:

  • the user only fills the lastname as XX
  • the user clicks save button
  • all the valid properties are reset to true
  • built-in validations detect an empty first name, set the first name valid = false and set firstname.validationmessage, at this point the form.valid is already false
  • your custom validations run to check lenght of lastname, you set lastname.valid = false, and an appropriate lastname.validationmessage
  • Now the If form.valid is checked, and the false branch is followed

scenario 2:

  • the user fixes the firstname, fills the lastname as AB
  • the user clicks save button
  • all the valid properties are reset to true
  • built-in validations are happy as both mandatory fields are filled, at this point form.valid is still true
  • your custom validations run to check lenght of lastname, you set lastname.valid = false, and an appropriate lastname.validationmessage, at this point form.valid becomes false
  • Now the If form.valid is checked, and the false branch is followed

scenario 3:

  • the user now also fixes the lastname as ABC
  • the user clicks save button
  • all the valid properties are reset to true
  • built-in validations are happy as both mandatory fields are filled, at this point form.valid is still true
  • your custom validations run to check lenght of lastname, this is ok, so no lastname.valid is changed to false, and the form.valid is still true
  • Now the If form.valid is checked, and the true branch is followed

Dorine

UserImage.jpg
SeungHwan Kim

You are the best Dorine. 

I'm deeply thankful to your answer. 

You helped me tremendously with my presentation at work. 

Thank you very much !

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.