[Solved] Help with troubleshooting a simple script?

0

Hey everyone, I’m just getting into scripting and I need some help! I feel this should just work… what am I missing?

 

Here’s what I have so far:

 

%%answer = sgapiGetValue(2);

if (%%answer = 1) {
sgapiJumpToPage(4);
}

if (%%answer = 2) {
sgapiJumpToPage(5);
}

 

Basically I want to jump to a page depending on what their answer was to the question ID 2. It’s just jumping to the same page no matter what they pick in the question though… why!?

 

http://i.imgur.com/qXcLHAz.gif

 

Thanks in advance!

Elizabeth Rose asked

    Best answer

    1

    Hey Elizabeth,

    It looks like you are using = when you need to be using ==. == and === are the operators you’ll want to use for is exactly equal to.

    http://www.w3schools.com/js/js_comparisons.asp

    https://media3.giphy.com/media/fdGkCOiM0oOqI/200.gif

    Cheers,

    Lizzy

    =)

    Lizzy Tekkel answered
      • Ok, that worked! Thank you!

        The link you gave me is talking about Javascript though, is that the same as Gizmo’s custom scripting? Can I use the functions and examples and stuff from Javascript with my custom scripting actions?

      • Hey Elizabeth- Custom scripting is php and JavaScript is JavaScript. I’d use a JS action for JS and Custom Scripting Action for PHP. =)

      ×

      Login

      Question stats

      • Active
      • Views1056 times
      • Answers1 answer
      • Followers0 followers