Why is this if-condition not working?

Hi all,

I am experiencing some issues and I have no idea what is wrong with the code.
Can someone please help?

The issue is that I try to make a distinction between the values in B to send two different messages.

The code:

{{ define "slack_alert_firing" }}
  {{ if eq (index .Values "B") 0 }}
    "Value B is 0: TEST"
  {{ end }}
  {{ if eq (index .Values "B") 1 }}
    "Value B is 1: Another message"
  {{ else }}
    "Value B is neither 0 nor 1: Handle accordingly"
  {{ end }}
{{ end }}

it’s giving the below result:

image

Kind regards,
Freek