Not equal to NULL and not equal to zero
Copy link to clipboard
Copied
I've seen a lot of posts on how to compare a value to v_null in order to make sure a field is not left blank. I'm trying to solve the opposite -- I need some fields to actually be blank and can't figure it out.
Help! (please!)
Copy link to clipboard
Copied
The variable v_null appeared in one of my blog posts 9 years ago, see that it has been taken over by many. That post has been updated recently:
http://blog.lilybiri.com/where-is-null-in-cp2017
Can you explain exactly what you want to do? Normally the logical expression with 'equal to v_null' should work.
Copy link to clipboard
Copied
Thank you so much for replying.
Our project is teaching users how to fill out specific forms. In many cases it is imperitive that the user understand that the standard is to leave a field blank vs entering a zero.
Equal to null works... but so does entering zero.
I've tried 'contains' as well, no joy.
Copy link to clipboard
Copied
As I tried to explain in the blogs, the workaround is due to the fact that blank, zero, all strings are considered to be not numeric and equal to 0. A variable has no type, it can be a string or numeric. Can you post a screenshot of the advanced action (use the Preview screen) you are using ? Tell which event is triggering the action and how you tested.
Copy link to clipboard
Copied
Each field has a cooresponding variable and a secondary variable to hold the score for that field. A simple clickbox triggers the action. It checks each field for the correct answer and assigns a score of 1 for correct. If incorrect a smartshape highlights the field. A later decision in the same action tallies them up.
Each decision is fairly simple. The user can keep trying until they get all answers correct, on submit on subsequent tries correct answers will remove the error indicator and populate the score variable.
Everything works except a zero being considered the same as null (empty).
Copy link to clipboard
Copied
Please, I asked for the Preview of that very long action.... Have a look at my post explaining all functionality of the Advanced Actions dialog box you are using, including the Preview button:
http://blog.lilybiri.com/advanced-actions-dialog-box-in-captivate-2017
You can try to add a condtion=
... is not equal to 0
Copy link to clipboard
Copied
Thank you for your patience, and for sharing that valuable information. Understanding the preview function will save me a lot of trouble in the future.
Here is the preview. It includes the latest attempt (adding condition is not equal to 0), which didnt' work.
Copy link to clipboard
Copied
Oops, never wrote such a long advanced action with so many decisions, and on top of it always an ELSE part.
Think there should be a better way, or switch to JS which may be necessary anyway. Please use states instead of show/hide, will probbably make everything a lot easier.
Did you try to put the zero in anoter variable v_zero for the comparison?
Copy link to clipboard
Copied
No luck with the zero being in a variable. 😞
I don't disagree with you about the JS, this would be much easier that way, but unfortunately we've been told to do it without. Perhaps when my boss understands that what he wants can't be done without JS he will change his mind.
I do appreciate your help with this!
Copy link to clipboard
Copied
It may be possible, but I would like to simplify the advanced action. However, do not have time now, am invited to a Xmas dinner...
Copy link to clipboard
Copied
I'll appreciate any input you have, after the holidays. Enjoy your dinner and time with family and friends.
Thank you for all you give to this community.
Copy link to clipboard
Copied
I'm trying to accomplish the same thing and what occurs to me after reading this is to attach an action so that if the user even clicks on an unacceptable blank it assigns that blank's variable as Done. Then, you can add to the advanced action that if "unwanted blank" = Done it marks it wrong. If ≠Done marks it right. I'll see if that works for me.

