Take a look at the Conditional statements section.
Use the if command to create conditions in format: if (<condition>) {<expressions>}. The condition statement returns the value of <expressions> if the condition is true, and a null value if false.
You are seeing the null value of the false condition of the if. By adding a return command, you can specify the value of firstIndex to be returned rather than the null value that the if would return if it is false...
{%if(DataItemIndex == 0){firstIndex = true;}; if(DataItemIndex > 0){firstIndex = false;}; return firstIndex; |(identity)GlobalAdministrator%}</span>