# Displaying content when 2 or more variable conditions are met

**URL:** <https://community.evolveauthoring.com/t/displaying-content-when-2-or-more-variable-conditions-are-met/2815>\
**Category:** General Help\
**Created:** [February 15, 2024, 11:06am UTC](https://community.evolveauthoring.com/t/displaying-content-when-2-or-more-variable-conditions-are-met/2815 "2024-02-15T11:06:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![andyontrack](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.evolveauthoring.com/andyontrack/32/1454_2.png) [@andyontrack](https://community.evolveauthoring.com/u/andyontrack)\
**Post date:** [February 15, 2024, 11:06am UTC](https://community.evolveauthoring.com/t/displaying-content-when-2-or-more-variable-conditions-are-met/2815/1 "2024-02-15T11:06:01Z")

</div>

Hi all,

I’m trying to get a block to appear when 2 variable conditions are met, but I just can’t seem to get it to work.  
Essentially, when I click a button, I want to display a block, but only if another variable is false. So upon clicking a button, it sets a variable (‘viewing\_content’) to true, and so long as the other variable (‘retried’) is false, it will display the content. However, if ‘retried’ is true, then the content shouldn’t display.

I’ve set up my logic as follows, and this works fine for the first time the action is triggered (viewing\_content = false and retried = false, then viewing\_content changes to true). However, when going back in after setting retried = true, the content still appears. I’ve also had a play around with different conditions, but nothing works as expected. Am I trying to do something that can’t be done, or am I fundamentally getting the logic comparison part completely wrong?

 ![Screenshot 2024-02-15 at 11.00.36](https://canada1.discourse-cdn.com/flex031/uploads/evolveauthoring/original/2X/0/0447c6b388d20e17ccfb5b6d88f719526227482f.png)

Thanks in advance,

Andy

---

<div class="post-metadata">

**Author:** ![andyontrack](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.evolveauthoring.com/andyontrack/32/1454_2.png) [@andyontrack](https://community.evolveauthoring.com/u/andyontrack)\
**Post date:** [February 15, 2024, 11:21am UTC](https://community.evolveauthoring.com/t/displaying-content-when-2-or-more-variable-conditions-are-met/2815/2 "2024-02-15T11:21:08Z")

</div>

So, I think I’ve figured it out! All I had to do was swap round the variables, so the ‘retried’ variable goes first, instead of second. This essentially blocks the action from happening. But if I’m completely honest, I’m not sure _why_ it works like this! If someone could explain how the variable comparison checks work, I’d really appreciate it, as it doesn’t appear to work on the standard ‘If…then…else’ approach.

 ![Screenshot 2024-02-15 at 11.20.14](https://canada1.discourse-cdn.com/flex031/uploads/evolveauthoring/original/2X/9/9be47e3056f0106a0096f87eafa36de1b7c7e08f.png)

Thanks,

---

<div class="post-metadata">

**Author:** ![Matt\_Leathes](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.evolveauthoring.com/matt_leathes/32/586_2.png) [@Matt\_Leathes](https://community.evolveauthoring.com/u/Matt_Leathes)\
**Post date:** [February 15, 2024, 12:37pm UTC](https://community.evolveauthoring.com/t/displaying-content-when-2-or-more-variable-conditions-are-met/2815/3 "2024-02-15T12:37:59Z")

</div>

It’s tricky to debug properly without being able to see your course but I wonder if the reason might be that you’ve flipped one of the conditions (for the `viewing_content` variable) when you’ve changed the order?

---

<div class="post-metadata">

**Author:** ![andyontrack](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.evolveauthoring.com/andyontrack/32/1454_2.png) [@andyontrack](https://community.evolveauthoring.com/u/andyontrack)\
**Post date:** [February 15, 2024, 1:01pm UTC](https://community.evolveauthoring.com/t/displaying-content-when-2-or-more-variable-conditions-are-met/2815/4 "2024-02-15T13:01:35Z")

</div>

Hi Matt,

Thank you for responding. Are you able to explain how the condition checking works in principle, particularly when there are multiple variables? That might help me figure out what I’ve done that makes it work (having something work is never good enough for me, I need to know why! 🙂 ).

---

<div class="post-metadata">

**Author:** ![Matt\_Leathes](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.evolveauthoring.com/matt_leathes/32/586_2.png) [@Matt\_Leathes](https://community.evolveauthoring.com/u/Matt_Leathes)\
**Post date:** [February 15, 2024, 2:33pm UTC](https://community.evolveauthoring.com/t/displaying-content-when-2-or-more-variable-conditions-are-met/2815/5 "2024-02-15T14:33:02Z")

</div>

The ‘equal to’ variable comparison check (for Boolean values) is done as a standard JavaScript ‘strict equality’ check i.e. `variable === value`

I think the problem is more likely to be something else - it’s just really hard to figure out what that is based just on the information here… if you happen to still have a copy of the course with the setup that wasn’t working (or can easily set one up) to share with me I can take a look and try to figure it out for you…

> [@andyontrack](#):
>
> having something work is never good enough for me, I need to know why!

100% agree with this!

---

<div class="post-metadata">

**Author:** ![andyontrack](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.evolveauthoring.com/andyontrack/32/1454_2.png) [@andyontrack](https://community.evolveauthoring.com/u/andyontrack)\
**Post date:** [February 15, 2024, 3:41pm UTC](https://community.evolveauthoring.com/t/displaying-content-when-2-or-more-variable-conditions-are-met/2815/6 "2024-02-15T15:41:43Z")

</div>

Thanks, Matt. I’ve created a duplicate of the course with just the logic part in but now, weirdly, I can’t replicate the issue, either in the duplicate or the original course! Happy to share either with you if you still want to poke around.

---

<div class="post-metadata">

**Author:** ![Matt\_Leathes](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.evolveauthoring.com/matt_leathes/32/586_2.png) [@Matt\_Leathes](https://community.evolveauthoring.com/u/Matt_Leathes)\
**Post date:** [February 15, 2024, 3:57pm UTC](https://community.evolveauthoring.com/t/displaying-content-when-2-or-more-variable-conditions-are-met/2815/7 "2024-02-15T15:57:49Z")

</div>

Yeah go on DM me a link to the version that should have the issue and I’ll take a look, can’t guarantee I’ll find anything if you can’t replicate the issue any more but I’m still curious to see what’s going on…!
