Skip to main content
Known Participant
February 2, 2016
Answered

Why doesn't "If variable does not equal null" work?

  • February 2, 2016
  • 2 replies
  • 998 views

Fairly simple thing I thought but it's driving me batty.....

On Captivate 8.

I have a checkbox widget and assigned variables to all 6 checkboxes (assessment1, assessment2...... assessment6). I also have a variable called "null" (thanks to lilybiri). The variable has no value to it.


So, in my advanced actions I have:


if assessment1 does not equal v_null or

if assessment2 does not equal v_null  or

if assessmen3 does not equal v_null

Then

Show Submit (button)


Meaning that if any of assessment1, 2, or 3 etc.... are checked, the assessment variables will be "something" and not "null" and should trigger showing the button but that does not work.....


Any ideas?


Thanks!


This topic has been closed for replies.
Correct answer Lilybiri

The problem is not with v_null not working, but with the fact that all conditions in such an action are always evaluated in sequence. Often the second decision will override the first:

  • If you put checking the last variable v_none as last decision, and it is checked, it will always reset v_int and v_doc to v_null; it will only work correct if v_none is checked. - that is correct
  • If you put that check as first decision, the second decision will check if one of the others are checked and will assign v_null to v_none; it will only work correctly if v_int and/or v_doc are checked

It is a logical problem! You need to consider all possible situations, and to me it is still not clear what you want. Here are some examples:

  1. User checks v_int and v_none: what has to be unchecked? - v_int has to be unchecked because v_none has been checked. We can't have none of the above checked and one of the above is checked... that would not make sense.
  2. User checks the three check boxes: what has to be unchecked? - If the user checks all three, then v_none has to be unchecked. Again we can't have none of the above checked and one of the above.... defeats the statement "none of the above"
  3. User checks only checkbox None of Above: fine, but there is no need for a conditional action - Correct
  4. User checks only Interactions: great, no need for an action - Correct
  5. User checks both Interactions and Documentation: no need for an action. - Correct

I have added comments inline above.

As for the course, we will be on SWF for quite some time. We haven't even updated to I.E. 10 and are still running I.E. 9 but I know the Widgets are SWF...


Sorry, I give up. You seem not to understand that you'll need another approach. Especially your answer to 1 is not correct, why has v_none priority, you are not in the mind of the person who checked this? For 2 you give the opposite, what if the user checked v_none really because he doesn't want it? Anywat it is not possible to check this with one conditional advanced action with two decisions, because the sequence should be reversed for the second situation compared with the first situation. Everything should be in one decision, with THEN/ELSE but I don't understand the logic, so cannot help you there.

2 replies

Lilybiri
Legend
February 2, 2016

I suspect you are referring to an old blog post I wrote, because you are using exactly the same name for that 'empty' variable as I did:

Where is Null? - Captivate blog

Did you create that empty variable?

Moreover using the operator 'is not equal to', is to be avoided, certainly in this case. You could perfectly have made this same condition with the much more to be trusted 'is equal to' by reversing the THEN and ELSE part. What has to be done when one of the conditions is TRUE? Maybe 'Continue' ? Put that in the THEN part and put your present OR combination in the ELSE part.

TLCMediaDesign
Inspiring
February 2, 2016

Can you post a pic of the advanced action?

Known Participant
February 2, 2016

Hi,

Here is what I have

Basically my company wants the user to check items on the checklist widget and one of the options has to be "None of the above." I created a variable called "unchecked" and that has a value of nothing (it's blank or null).

Here, basically I am saying that if noneOfTheAbove is checked, it obviously isn't blank. Then I assign the other checkboxes with "null" or "blank" so you can't have a "none of the above" and another checkbox selected.

Any ideas?

Thx.....

TLCMediaDesign
Inspiring
February 2, 2016

Well that is nothing like your original post.

I seriously doubt that you can uncheck a checkbox by assigning a variable to it.

I create variables, cb1, cb2, cb3 assigned to each checkbox.

If your user selects the None of the Above checkbox and any other checkboxe(s) what are you going to do with that information?