Hello -
I am looking to use embedded data fields in the survey in order to show different color schemes for the survey. Is there a java script that would allow me to say "If embedded data is 'blank1', then show (java script for one color scheme). If embedded data is 'blank2', then (insert java script for second color scheme)."?
I currently have the color scheme java script in place, however, I am looking for the ability to implement these "if, then" scenarios.
Thanks in advance.
-Joseph
Page 1 / 1
You can pipe embedded data into a JavaScript. For example:
```
var myvar = "${e://Field/myedf}";
```
Just make sure the piped string is always in quotes.
```
var myvar = "${e://Field/myedf}";
```
Just make sure the piped string is always in quotes.
And then if `myvar` is blank, you can use something called a coalesce operator `||` as follows:
`const finalVar = myVar || 'alternate value';`
`const finalVar = myVar || 'alternate value';`
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.