- This topic has 3 replies, 2 voices, and was last updated 5 years ago by Alexander Bautz.
-
AuthorPosts
-
-
November 18, 2019 at 11:18 #27671
Hi Alex,
Overview
I would like to request a feature that allows users to create field validation with more utility than the out of the box column validation.
Use Case
The requirement to ensure that form data entered is valid and reduce the risk wherever possible for user error.
Solution Example
Adding a Backend DFFS tab with the ability to select a field, event trigger and function to allow users to validation and return a message, true or false and display under the fields.
I have attached a basic mockup. The following could be used as a user created function to validate fields.
const validateTitle = () => { // Get Field Value const title = getFieldValue("Title"); // Perform some type of validation check if (title.length < 7 || title.length >= 10) { // Return a message as a string return "Title must be between 7 to 10 characters"; // Alternative, return true for a default message of "Field validation failed, please try again..." } else { // Return false to pass validation (would probably make more sense to return true, // but I think this provides the least amount of code.) return false; } };
If there is anything else I can provide please let me know and apologies if I have missed a feature already listed in the forums.
Cheers,
- This topic was modified 5 years, 1 month ago by Ross.
Attachments:
-
November 19, 2019 at 18:20 #27692
Good idea, I’ll see if I can add something similar in the next version. I think I might just add it to the rules as a new “operator” like “validate with custom function” so you can create a rule and specify a validation function that you add in Custom JS.
This way your validation can use all the rule trigger functionality in case it does not validate.
Alexander
-
November 20, 2019 at 03:47 #27697
Hi Alex,
Thanks for the response and having it in rules makes sense.
If you do get around to doing this and need some testing of it, let me know.
Cheers
-
-
November 28, 2019 at 22:09 #27778
I have added this as a new operator – select a text or number field from the “If this triger” field and select the operator “validate with custom Function”. See help icons on the operator field for an example.
You find the new version here: https://spjsblog.com/2019/11/28/dffs-package-updated-to-v4-4-4-16/
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.