Problem:

REDCap “sees” zero differently for branching logic depending on its context:

  • “0” or ‘0’
  • 0 (an integer)

If you use want to branch logic based on the value of a field being zero, use quotes (single or double).  Note: there is not a similar issue with unity (1).

Solution:

Replace

[var] = 0

with

[var] = ‘0’