---
schema_version: "1"
id: b7913422ab0d8df2aa1de5bb47b885299ab7a0c3081bc61245b88620cb2d48a4
title: "Handlebars Helper Function: iif"
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/handlebars/reference/comparison/mcn-handlebars-reference-comparison-iif.md
canonical_url: https://developer.salesforce.com/docs/marketing/handlebars-for-marketing-cloud-next/references/mcn-handlebars-comparison-references/mcn-handlebars-reference-comparison-iif.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 80f6e53d4ccd593da60889a0f38708d9de9f66927e7e84dd6ef87661dc9cdc3d
products:
  - Handlebars for Marketing Cloud Next
  - Marketing Cloud
---
# Handlebars Helper Function: iif

Evaluates an expression and returns one of two values based on whether the expression is `true` or `false`. This function works similarly to a ternary operator in other programming languages.

## Availability

This helper is available in the Winter ’26 release of Marketing Cloud Next.

## Syntax

```handlebars
{{iif expression leftResult rightResult}}
```

## Parameters

| Parameter     | Type | Description                                                           |
| ------------- | ---- | --------------------------------------------------------------------- |
| `expression`  | Any  | Required. The expression to evaluate.                                 |
| `leftResult`  | Any  | Required. The value to return if the expression evaluates to `true`.  |
| `rightResult` | Any  | Required. The value to return if the expression evaluates to `false`. |

## Return Value

The function returns `leftResult` if the expression evaluates to true according to truthiness rules, otherwise returns `rightResult`. Truthiness evaluation follows these rules: `null` is `false`; boolean values are returned as-is; `0` is `false`, any non-zero number is `true`; empty string `""` is `false`, any non-empty string is `true`; empty arrays `[]` and empty objects `{}` are `false`. Both `leftResult` and `rightResult` are always evaluated, regardless of which is returned.
