Oct 03, 2022 02:11 PM
I have a table whose user entered fields are susceptible to errors arising from invalid conditions between two or more fields. For example:
I want the user to be alerted to a lot of error conditions as they enter data or view records, but I don’t want a whole bunch of formula fields alerting the user and cluttering up the users’ views or interfaces.
To keep things simple for the user I created just one formula field to concatenate together all possible error checks. Each term in the concatenation returns a descriptive message if the error check logic detects a problem, or a zero-length string if the error check logic doesn’t find a problem.
An extract from the final formula field looks like this:
IF(IS_BEFORE({Expiration Date},{Effective Date}),
"❌ Expiration date is before effective date.\n",
""),
IF({#Items}=0,
"❌ This Placement Group contains no copy items.\n",
""),
IF(NOT({Default Copy Type}),
"❌ Default content type is missing.\n",
"")
This approach puts all error check logic in one field. As long as you’re willing to copy the field to your favorite text/code editor it’s easy to maintain this field.
Tweaks:
The result is a single field that makes it easy for the user to see if the table row has interfiled errors. I’m happy with the result but I’m betting that other folks might have the same problem and figured out a more simple or foolproof way to handle it.
Is there an easier/simpler way to do this?
Solved! Go to Solution.
Oct 04, 2022 11:22 AM
I do this too. I tend to name this type of formula field {Data Validation}.
I tend to leave off the third parameter in the IF
functions. It is less to type, less to read, and still works.
Sometimes I add record coloring based on this {Data Validation} field. Sometimes I create new view that only shows records there this field is not empty.
Oct 04, 2022 10:50 AM
For what it’s worth, I have built very similar types of status/error handling in several projects.
Oct 04, 2022 11:22 AM
I do this too. I tend to name this type of formula field {Data Validation}.
I tend to leave off the third parameter in the IF
functions. It is less to type, less to read, and still works.
Sometimes I add record coloring based on this {Data Validation} field. Sometimes I create new view that only shows records there this field is not empty.
Oct 11, 2022 09:25 AM
Thanks! Data Validation is more understandable than “QA”. QA is IT jargon. I’m going thru and removing the third parameter when I’m editing a table that contains a Data Validation field.