• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

New Here ,
Feb 01, 2016 Feb 01, 2016

Copy link to clipboard

Copied

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!


Views

745

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 02, 2016 Feb 02, 2016

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. Ev

...

Votes

Translate

Translate
People's Champ ,
Feb 01, 2016 Feb 01, 2016

Copy link to clipboard

Copied

Can you post a pic of the advanced action?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 02, 2016 Feb 02, 2016

Copy link to clipboard

Copied

Hi,

Here is what I have

advancedActions.png

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.....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Feb 02, 2016 Feb 02, 2016

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 02, 2016 Feb 02, 2016

Copy link to clipboard

Copied

The project was evolving but wanted to figure out the "if variable is not equal to null, then do something" but same premise as the original.

I can uncheck a checkbox by telling it to assign the variable to blank. It's working now. So if we have cb1, and/or cb2 checked, and someone checks "None of the above" I assign cb1 and/or cb2 to null and it works nicely, clearing the checkboxes and assigning the value to null (blank).

If the user checks none of the above, it is a self assessment and nothing is done with that information. They just don't want to see "none of the above" checked along with another checkbox.

Right now it is working to uncheck the boxes when someone checks none of the above. What isn't working is that if none of the above is checked and someone checks cb1 or cbs, it unchecks none of the above (by assigning the variable to null).

It's hard to wrap your head around this I know......

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 02, 2016 Feb 02, 2016

Copy link to clipboard

Copied

Because you didn't answer to my questions, you ignored my answer. Now seeing something totally different from the original question, I didn't continue answering anymore.

Do not use the operator 'is not equal to' with the dummy variable v_null.

Are you using the checkboxes interaction? I repeat the same question: did you create the variables necessary for this interaction?

Tips - Learning Interactions - Captivate blog

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 02, 2016 Feb 02, 2016

Copy link to clipboard

Copied

Hi Lilibiri,

Sorry but part of my response included response to some of your questions. To answer your questions specifically, see below.

Yes I am using the checkboxes interaction widget and created the approvriate variables along with setting them in the widget. Here I have 3 checkboxes with one specified as none of the above. The "null" variable is blank with no value and I called it "unchecked."

So, if I am not supposed to use  'is not equal to' with the dummy variable v_null, then how can I tell if one of the checkboxes is checked? That is the basis of what I am trying to figure out.

  1. If "none of the above" isn't blank, it must be cheched, so.... uncheck the rest
  2. If "none of the above" is checked and someone checks one of the other checkboxes, it clear none of the above
  3. If any of the other checkboxes are checked and someone checks "none of the above", it clears the other checkboxes (this works).

There must be a way to tell if the checkbox isn't blank..... then do something with that result.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 02, 2016 Feb 02, 2016

Copy link to clipboard

Copied

I explained before, reverse the condition, and use the ELSE part. I'm sorry, but I explained in the blog post that using the variable v_null is a workaround because Captivate doesn't see the difference between a number and a string. The first condition that you showed was even logically not correct with the combination of OR. And you never showed the ELSE part of the condition.

Checkboxes interaction's display cannot be controlled by actions if you use HTML output neither. If you use the latest version of the interaction, it can be controlled but only for SWF output.

I suspect you make this too complicated. The content of the original question was totally different from the following one. If you decide first what you really want to achieve?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 02, 2016 Feb 02, 2016

Copy link to clipboard

Copied


This is basically what I want to achieve:

  • If "none of the above" isn't blank, it must be cheched, so.... uncheck the rest
  • If "none of the above" is checked and someone checks one of the other checkboxes, it clear none of the above
  • If any of the other checkboxes are checked and someone checks "none of the above", it clears the other checkboxes (this works).

So to use reverse and else, how would you state

  • if "none of the above" is checked and someone checks one of the other checkboxes, keep that checkbox and clear "none of the above"?

As for how complicated it is, it really shouldn't be that complex and a "none of the above" scenario should be able to be achieved. Plus when your boss "demands" something to be done, you have to try your best to do it......

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 02, 2016 Feb 02, 2016

Copy link to clipboard

Copied

Sorry, I don't understand this. Isn't the user checking the boxes? Why don't you use two instances of that checkbox interaction:

  1. with all the choices except the None of Above
  2. with only None of Above

Which event do you use to trigger that conditional action? Since this is a "static", not an "interactive" interaction  (using the former categories of widgets) there is no event for the interaction itself. DO you use a button that the user clicks after checking boxes?

Do you need HTML output? In that case you cannot uncheck boxes by actions. I am repeating myself, sorry.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 02, 2016 Feb 02, 2016

Copy link to clipboard

Copied

Yes the user is checking boxes. In the widget I have:

After the course I understand:

  • How to use the interface (checkbox1)
  • How to assign documents to a new user (checkbox2)
  • None of the above (noneOfTheAbove)

This is all dynamic, I have a rollover sidelet that has an advanced action on rollover that is behind the widget so everytime the mouse is over the widget it evaluates the state of the items in the widget... so the instance you click something or move your mouse, it runs the advanced action. This was the only way that I could make actions in the widget real-time active. So, every time the mouse is moved, it triggers the advanced action with the conditions.

Not elegant but it works.... sort-of.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 02, 2016 Feb 02, 2016

Copy link to clipboard

Copied

This means no HTML output, right? Hope that course doesn't have to live too long...with SWF being EOL. I will label the variables corresponding with the checkboxes:

    v_int   for the item Interactions

    v_doc  for the item Documentation

    v_none for the item None of Above

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.
  • 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?
  2. User checks the three check boxes: what has to be unchecked?
  3. User checks only checkbox None of Above: fine, but there is no need for a conditional action
  4. User checks only Interactions: great, no need for an action
  5. User checks both Interactions and Documentation: no need for an action.

Do you understand? You cannot create an action when you have no unique situation in which that action has to happen.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 02, 2016 Feb 02, 2016

Copy link to clipboard

Copied

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...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 02, 2016 Feb 02, 2016

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 02, 2016 Feb 02, 2016

Copy link to clipboard

Copied

Yes I give up as well....

Thanks for trying to help though. I had tried another approach prior and you pointed me towards the checkbox widget and that is the direction I went in but now that is not the right direction?

For the logic, I don't understand why this is so complicated. We have 3 statements with one of them being none of the above. If someone checks none of the above, then logically none of the ones above should apply (hence none of the above). As soon as none of the above is selected, it clears all of the above, only leaving none of the above checked.

I will figure it out and it will work eventually.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 02, 2016 Feb 02, 2016

Copy link to clipboard

Copied

Issue is that you don't ask for a confirmation, but trigger it by rolling over. A user can check two check boxes before the rollover occurs. Why do you decide which one has priority? My engineer's mind tells me this is not logical. I would prefer launching a warning to the user, who is the focus of every learning, if they checked 'None' together with one of the others? Or leave that None alone, if they didn't check anything, it means 'None'?  Even in that case I would like to ask them for a confirmation.

This is not linked with the checkbox interaction, would have been the same if you make your own check boxes! The situations are not clear at all. I have been writing tons of conditional actions, trained about them, know really the way Captivate is treating everything. Look at this post, where I solved a more complicated use case, that no one would tackle:

Custom Short Answer Question - Captivate blog

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 02, 2016 Feb 02, 2016

Copy link to clipboard

Copied

LATEST

I agree  with you 100% when you say when the user selects nothing, it means essentially none of the above applies but I got into an Abbot and Costello routine with the "direction" that someone has to select SOMETHING in order to procees. So why force someone to check something they don't agree with?..... that isn't right, so..... in came "none of the above." If they MUST check something, at least let them check something that says they don't agree with anything listed here.

I don't like it as much as you but my hands are tied and I am trying to make the most of this "interesting" situation.

Thanks again for your time and prodding.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 01, 2016 Feb 01, 2016

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources