IF/ELSE Error

// Here initialize a variable called price, make it empty (using a
Constant String block)

IF STRINGKEY @data.SOURCE Contains “networkPrice”
// Parse block with the networkPrice jtoken, put it in the price
variable
ELSE
// Parse block with the other jtoken, put it in the price variable
END

that is the code I currently use incase it doesn’t detect the first parse J Token but would there be a way to add like a third parse block incase it doesn’t detect the second parse J Token? I tried adding another ELSE but it responds with “else’ cannot start a statement.”

// Here initialize a variable called price, make it empty (using a Constant String block)

IF STRINGKEY @data.SOURCE Contains "networkPrice"
// Parse block with the networkPrice jtoken, put it in the price variable
ELSE IF STRINGKEY @data.SOURCE Contains "otherThing"
// Parse block with the otherThing jtoken, put it in the price variable
ELSE
// Parse block with the other jtoken, put it in the price variable
END

You mean something like this?

1 Like

Yes thank you now how would I do something like
IF @Category Contains "Nut Drivers & Keys" @data.STATUS ="CUSTOM" IF @Name DoesNotContain "Set"

IF STRINGKEY @Category Contains "Nut Drivers & Keys"
data.STATUS = "CUSTOM";
return;
END

I don’t think I understood the second part, did it get cut off?
If you want to put 2 IFs you can do it

IF …
IF …

END
END

it will basically only execute the stuff inside if both are true.
For more advanced stuff you should use C#.

I want the first part to execute the second part if @Category Contain “Nut Drivers & Keys” and then if the second one is true set the status as CUSTOM which will end the bot

IF STRINGKEY @Category Contains "Nut Drivers & Keys"
IF STRINGKEY @Name DoesNotContain "Set"
data.STATUS = "CUSTOM";
return;
END
END