Skip to main content
Known Participant
Oct 20, 2021 11:21 AM UTC
Question

Don´t save value if validation field triggers

So, i have a date that cannot be > than today(), so i have a validation field. But when I enter a wrong date, the validation field triggers but it saves the save value into my rule input. It is possible to don´t save the value if the validation field triggers?

5 replies

stefanhelzle0001
Brainy
Oct 20, 2021 11:44 AM UTC

No. Validation is meant to prevent the user from submitting the form.

peter.lewis
Employee
Oct 20, 2021 1:24 PM UTC

Stefan is correct, and to expand on this I don't think you would even want the behavior you specified. Suppose that you altered your date field so that if the user entered a date greater than today it wouldn't save. In that case they would enter a date, and then if it didn't meet the criteria the data would disappear. It's actually a good thing that the value saves so that the user can see the results and understand how to fix it.

johnm744
Inspiring
Feb 4, 2022 1:15 PM UTC

Hi Peter, now my question,  It's posible to save the validations in a local!variable?   thanks 

New Participant
Feb 4, 2022 6:53 PM UTC

You can check the value before saving into any variables, like below,

a!save(
ri!date,
if(save!value<today(),
save!value,
null)
)