> For the complete documentation index, see [llms.txt](https://support.emarketeer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.emarketeer.com/references/developer-advanced/dcl-introduction/conditionals.md).

# Conditionals

Conditional functions follow normal function syntax and always return an empty string. They cannot be used as arguments to other functions. You can test for equality or inequality. There is no concept of boolean operators, but you can simulate AND by nesting conditionals.

Check if "foo" is equal to "foo" (true):

```
<% if compare="foo" equal="foo" %>
```

Check if "foo" is equal to "bar" (false):

```
<% if compare="foo" equal="bar" %>
```

Check if "foo" is not equal to "foo" (false):

```
<% if compare="foo" notequal="foo" %>
```

Check if "foo" is not equal to "bar" (true):

```
<% if compare="foo" notequal="bar" %>
```

Full example of a conditional block:

```
<% if compare=<% contact field="firstname" %> equal="Bart" %>
    You're Homer's son! 
<% elseif compare=<% contact field="firstname" %> equal="Lisa" %> 
    You're Homer's elder daughter! 
<% elseif compare=<% contact field="firstname" %> equal="Maggie" %>
    You're Homer's younger daughter! 
<% else %> 
    Doh! 
<% endif %>
```

Below we use the boolean `or` in an expression. To use an `and`, just replace `or` with `and`. Internally, the `if` function checks its `and` or `or` argument for `true`.

```
<% if compare=<% contact field="firstname" %> equal="Bart" or=<% if compare=<% contact field="firstname" %> equal="Lisa" %> %> 
    You're Homer's child
<% endif %>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.emarketeer.com/references/developer-advanced/dcl-introduction/conditionals.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
