70
Views
5
Comments
Solved
Table validation of inputs

I am having an issue with validating input in a table.


I have a table called AgeGroups.
I want to validate each input upon saving. 
Each group's minimum should not be greater than the maximum of the same group.

The minimum of the next group should also be greater than the maximum of the previous group.

I have attached an example of the code without the validation. 

I inserted the table in a form but am not able to validate using out-the-box validation. 
I have also gone through a couple of resources but have not been able to implement them.

Resources: 
https://www.outsystems.com/forums/discussion/5805/validation-inputs-inside-table-records/

https://www.outsystems.com/forge/component-overview/13879/listvalidation



TableVaildation.oml
2021-10-01 12-43-46
N_SG
Solution

Hello @Weston Nyirenda,

As per my understanding of your query, I have created the required functionality, You can check the demo here
Also attached the same oml for your reference.

Hope it helps.

Regards
N_G

TableVaildation.oml
2023-06-20 09-40-15
Weston Nyirenda

Hi @N_G,

This solution solved my problem. Much appreciated. 

2023-06-20 09-40-15
Weston Nyirenda

Hi @N_G,

One update that needed to be made is resetting the PreviousMaxValue to 0 if the CurrentMinimum > PreviousMaxValue evaluates to False. Otherwise, It will continuously evaluate to false. 

TableVaildation.oml
2021-10-01 12-43-46
N_SG

Hi @Weston Nyirenda, Yes you are correct. I just implemented for  the positive case, for handling the negative scenario as well it might require to reset "PreviousMaxValue" in  maybe be in couple of places.

Thanks for letting me know. :)

Regards
N_G

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Weston,

I don't have time to look at the module you attached, but what exactly is the problem you are facing? You clearly describe the conditions you have to check, so you could implement them in OutSystems? Use a For Each to loop over all the items in the list, and verify if they conform to what you want?

2021-10-01 12-43-46
N_SG
Solution

Hello @Weston Nyirenda,

As per my understanding of your query, I have created the required functionality, You can check the demo here
Also attached the same oml for your reference.

Hope it helps.

Regards
N_G

TableVaildation.oml
2023-06-20 09-40-15
Weston Nyirenda

Hi @N_G,

This solution solved my problem. Much appreciated. 

2023-06-20 09-40-15
Weston Nyirenda

Hi @N_G,

One update that needed to be made is resetting the PreviousMaxValue to 0 if the CurrentMinimum > PreviousMaxValue evaluates to False. Otherwise, It will continuously evaluate to false. 

TableVaildation.oml
2021-10-01 12-43-46
N_SG

Hi @Weston Nyirenda, Yes you are correct. I just implemented for  the positive case, for handling the negative scenario as well it might require to reset "PreviousMaxValue" in  maybe be in couple of places.

Thanks for letting me know. :)

Regards
N_G

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