If else issue

this is my code . if my count value greater than 1 i need to compute , if not i need keep the value 0 or 1 . what as my issue was, now after the if i cant able to use the “take1” variable outside the if else.

error showing:- The name ‘take1’ does not exist in the current context. how to use the output out ?

IF INTKEY @countOccurrencesOutput GreaterThan 1

BLOCK:Compute
  input = $"<countOccurrencesOutput>+1"
  SAFE
  => VAR @take1
ENDBLOCK

ELSE
BLOCK:ConstantString
  value = @countOccurrencesOutput
  SAFE
  => VAR @take1
ENDBLOCK

END

You need to initialize the take1 variable at the start of the config, even with an empty string, otherwise the variable does not exist outside of the scope of the IF/ELSE block. Variables that you declare inside an IF/ELSE block (and similarly for WHILE, FOR EACH etc.) are not accessible outside of them.