0

What is your preferred Data Validation Strategy.

Using the Project database template as an example, the Task object has Beginning and End dates. Logically, the End date should be greater than (or equal to) the Beginning date. What are the various strategies for data validation?

1. Add an after update trigger to the End FIELD.
if text(End) != "" then
   if End < Beginning then
      alert("End date [" + End + "] must be after Beginning date [" + Beginning + "]");
   end
end

Not a bad approach, but it still allows for invalid data. While the alert will display, there is nothing to prevent the user from still saving the row.

2. Wipe out the invalid data
if text(End) != "" then
   if End < Beginning then
      alert("End date [" + End + "] must be after Beginning date [" + Beginning + "]");
      End := ""
  end
end

Not a big fan of changing user input.. plus once the alert is closed, they loose what data was entered.

3. Create a Multiple Choice field that contains all the various error messages / conditions and set this value via FIELD after update triggers. Then, on the TABLE after update trigger, if the error field is not empty, display an alert.... For each table, create an Invalid Data view that filters for the error value not empty.

Maybe the best approach, but if you have numerous table objects, could be numerous views.

4. Create an Errors Table.. and create record for each error condition.

Once the User Interface Automations are implemented in all environments, this may be a good solution.

5. ??? Other suggestions???

6 replies

null
    • Mconneen
    • 5 yrs ago
    • Reported - view

    Sorry.. I just relaized there are different sections / tabs to the user forum.   This topic would have been better in the Ideas and Suggestions area.. :( 

    • remy.1
    • 3 yrs ago
    • Reported - view

    Hello :)

    This old topic seems to be still to reopen...

    With this technic - the field will be empty but the validation is passed and the record is saved with blank value in this field and it is not acceptable in my case ?

    The points 3 and 4 must be set but it is the job of the database engine I think  :)

    Any idea ?

    Regards.

    Remy

    • Mconneen
    • 3 yrs ago
    • Reported - view

    @Remy, 

    This topic did not generate too much interest.  It could be that I posted it in the wrong portion of this forum. 

    I do agree with you, if a "required field" is NULL, the database engine should honor that .. and NOT insert it..   But, alas.. that is not how Ninox works.  I do enjoy creating applications in Ninox.. it is super powerful and cross platform..  You just have to contend with some data integrity processes.. 

    • remy.1
    • 3 yrs ago
    • Reported - view

    Thanks for you response :)

    Do you know if this topic is on the to do list or planned for futur enhancement ?

    Remy

    • Sean
    • 3 yrs ago
    • Reported - view

    I think Frank makes it clear in this post that they do not intend to change their input paradigm...

     

    https://ninox.com/en/forum/ideas-and-suggestions-5abb9f4f45eda7ea1e75ed02/urgent-change-5d1b8bdeeee76263173ede13?page=3

     

    Here's the translation...

     

    Antonello Stabile 71,
    Monk (112)
    Tuesday, July 28, 2020 11:23 AM
    Despite the new version, the requested change was not made. Can you understand that a serious database must have the possibility that the required fields to be filled in cannot be left empty?
    Ninox Profile
    Frank Böhmer,
    Master (422)
    Wednesday, July 29, 2020 6:25 AM
    The Ninox paradigm is to always save changes directly. To implement the requested change we would have to change the whole template into an explicit confirmation (OK button). It is a compromise. You can implement your own button which will only set a certain state if all validations pass.

     

    I might be off the mark with this suggestion, but I posted a database named "Undo Example" on the Webinar EN 2020 team that demonstrates how to make changes or add records indirectly which allows you to all the data validation you want.

    • remy.1
    • 3 yrs ago
    • Reported - view

    First - I agree - there is a lot of interest to have this direct save on Ninox !

    If I follow the paradign - save changes directly - google with GMAIL does the same :)

    But when an email do not pass the validation rules - it goes to the draft - maybe some like a draft in Ninox will be a way to keep the paradigm and enforce the posting rules of the database...

    I will look at your "Undo Example"  - may be it is a way to help me !

    Many tanks to you.

    Remy

Content aside

  • 3 yrs agoLast active
  • 6Replies
  • 2154Views