conditional triggers
Nov 19, 2019
I have created a slide with 6 buttons. Each button has the state normal and selected.
The idea is the user can select the buttons that show actions they have already completed and not select the actions they are yet to do. They can also un-select the button if they change their mind.
The Buttons default to false when not selected or un-selected (blue) and true when selected (green) using the Toggle command.
After the user makes their choices click on the submit button bringing up the "recommendations layer".
On this layer I would like to list the actions they need to take based on the actions they have not taken. So, there should be an action for each 'false' button.
Ideally, I would like to somehow create a list of 3 next recommended actions with hyperlinks and in order of priority - in this case from the top down.
For example
if button 1 is false
show recommendation 1
if button 2 is false
show recommendation 2
if button 3 is false
show recommendation 3
and this works fine for the first 3 buttons, the trouble Im having is when for example button 1 = true & button 2= true, I then when recommendations 3, 4 & 5 to list, and so on for any combination
I believe i would need to use javaScript for this and I'm not sure where to start.
Instead I have created a list of all the recommended actions with 2 states - normal (greyed out) and recommended action (black).
I have created a trigger to show the recommended action when any of the buttons = false. Buttons 1,2 & 3 will always work with simple true or false trigger, but when for instance buttons 2 & 4 are false I need to get recommendations 1,3, & 5 to show as black (not 6 because I only want the top 3 recommendations)
but I can't get it to work
it needs to be
show action 5 text as black if
button 5 is false and (button 1 or button 2 or button 3 or button 4 are true)
but it seems to work as
(button 5 is false and button 1 is true) or button 2 or button 3 or button 4 are true).
Is anyone able to help either writing some Javascript or setting the triggers?
Many thanks in advance
Cath
9 Replies
Hello I was looking at this but have a question. You said top 3 suggestions, what happens if they only have one or two? Are you forcing them to have 3-6 suggestions, or allowing them to have 1 or 2 only? If so then the following page would say something different yes?
So one thing I see right off the bat is that you can't use conditional statements like you are. mixing and and or statements. The best way to change that is to have it the same as all the others with just the if variable equals false. In a separate trigger before it in the list you can adjust the false variable to true if the other ones are false. So for example. Change Dom1stClearchoise5 to true is the others are true. That may not be exactly what you are trying to do but you get my drift.
Hi Jeff, thanks for your reply. No it would be 3 or less suggestions, but not more than 3.
HI Randy, thanks for your reply. Good to know I can't mix and /or statements. I'll test changing the the true/false and see how that goes.
Hello, see if this does what you want it to do. Not super elegant but I believe this is what you were trying to do? I didn't do anything to reset on close (X) because wasn't sure what you wanted to do.
Hi Jeff, this is exactly what I was looking for. Thanks you so much!!
I will need to reset all of the variables when the user revisits the page or closes the layer. I'm thinking I create a - when time time starts adjust variable and set the value. is that the best way?
Hello, there are a few ways to do this, I updated the file with resetting on timeline and on close, see attached.
Jeff, this is fantastic, thank you so much for your help, it is invaluable.
Thank you, I am happy to help and glad that it worked the way you wanted, good luck with your project ;0)
This discussion is closed. You can start a new discussion or contact Articulate Support.