How to convert iso to OB2?

how to convert iso to OBD2?

IF "<SOURCE>" Contains "Balls"

FUNCTION Constant "have" -> CAP "Toys" 

ELSE

FUNCTION Constant "don't have" -> CAP "Toys" 

ENDIF
IF STRINGKEY @data.SOURCE Contains "Balls"
BLOCK:ConstantString
  value = "have"
  => CAP @Toys
ENDBLOCK
ELSE
BLOCK:ConstantString
  value = "don't have"
  => CAP @Toys
ENDBLOCK
END
1 Like

thank you very much, it worked perfectly

1 Like

Make sure you initialize the Toys variable outside of the if/else statement (e.g. with a constant block before it) otherwise it will only be printed to the log but not actually added to the capture, this is due to a C# mechanic since all the code is transpiled to C# before execution for speed

2 Likes

I was studying and I realized that. I’m really enjoying ob2 much faster than ob1 in the responses. I’m just having trouble with some study sites where I enter request POST and it returns something like GET

I am aware of that, check if there is an issue on github about it, otherwise feel free to open a new one.

1 Like