"Not" function

Hello,

I'm trying to add some logic into my survey that applies when a respondent did NOT see a previous question. I'm nesting this in a Javascript if statement, but I think my Not function isn't working properly.

I'm using this syntax: [% Not Shown(Q1) %] - I see a 1 if Q1was not shown (as intended), but Q1 is shown, the value is blank (rather than 0 or false). Is there a specific way to write this so it returns a 0 if they saw the question and 1 if they did not?

Specifically, if I use the following Javascript to test this, I would expect to see either "Not Shown" or "Shown" depending on if I see Q1. However, it doesn't appear to be returning anything, which makes me think that something is wrong with my if statement. Any help would be much appreciated!

<script> 	
	if ([% Not Shown(Q1) %]){
		return "Not Shown"
	}
	else {
		return "Shown"
	}
</script>
1
2 replies