There needs to be a single, universal way to TEST for EMPTY INPUTS

There needs to be a single, universal way to TEST for EMPTY INPUTS

I am so sick of having to code multiple conditions just to see if a field is empty or not.

EXAMPLE SITUATION

I have a Validation workflow that runs when a user hits Submit on a form. The workflow looks to see if the user filled in a required field (Before you ask... I cannot just set this to a "required field" in the form designer because I need it to be conditionally required)I have the action set to run only when the field is null or equals "". 

Result: The action fails to run even though the user didn't enter anything in the field



So I did some testing, and... Here's what Zoho thinks of a field that is completely empty and hasn't been touched by the user...

   field == ""
   TRUE
   field.isEmpty()
   TRUE
   field == null
   FALSE
   field.isNull()
   TRUE

WHAT?!?!?!


PROBLEMS

There are 2 problems I want to highlight here:
  1. field == null and field.isNull() should both be considered TRUE, in my opinion. I don't understand why Zoho treats these two conditions differently.
  2. Even though deluge considers field == "" to be TRUE, the Criteria Editor in the Workflow/Actions page obviously doesn't. Otherwise, it would've allowed the action to run.
This is incredibly frustrating and makes this feature completely untrustworthy. What is the point of setting up conditions for actions if they aren't going to do their jobs? Because of this, I have hundreds of workflows that start like this:
  1. if ( field == null || field == "" || field == "null" || field.isNull() || field.isEmpty() || field.isBlank() )
  2. {
    1. (execute some code)
  3. }
I have to put all those conditions in because I never know how Zoho is going to consider a particular input field. To make matters even worse, this code won't even run if the field is an integer since you cannot compare an integer to a string, even if the string is "". So I have to remember to code all my conditions like this:

   Field Type
   Code for Testing Empty Inputs
   single line
   field == null || field == "" || field == "null" || field.isNull() || field.isEmpty() || field.isBlank()
   integer / float
   field == null || field.isNull() || field.isEmpty() || field.isBlank()
   bool
   field == null
   etc...
   etc...

And to make it EVEN WORSE, testing empty strings isn't that straightforward because sometimes users will start typing something into a field, change their minds, delete their input, and unknowingly leave behind a rogue SPACE character. The "empty input test" above would fail to catch a field containing nothing but a space character. Now I have to change field == "" into this: field.trim() == "".

That itself isn't a big deal UNTIL you try to use that same test for deluge variables. Let's say you call a function within your workflow and the function returns a null value. NOW when you try to see if the function returned an empty value, you can't use the .trim() function because you cannot trim a null value. The code breaks.

So when testing for empty values in Zoho Creator, you have to consider (A) where you are implementing the condition, (B) what type of field you are testing, (C) what type of value you consider to be "empty", (D) whether you are testing for a form field value or a deluge variable value. It's an inconsistent nightmare that results in so many errors and workflow failures.

PROPOSED SOLUTION

Wouldn't it be great if there was a catch-all function for testing if something is empty??? For example:
  1. if ( anyType_ofFieldorValue.isCompletelyFreakingEmpty() )
  2. {
    1. // I would be a much happier deluge coder
  3. }
I though the function "isValidObject()" would do the job, but it doesn't. It also produces inconsistent/unreliable results.


Thank you for coming to my TedTalk. Good day.