---
title: Logical Functions in Appian
description: Learn how Appian's logical functions behave.
---

[The convedo Blog](http://info.convedo.com)

# [Logical Functions in Appian](http://info.convedo.com/logical-functions-in-appian)

 Written by [Lukas Meihsner](http://info.convedo.com/author/lukas-meihsner) | 01 September 2025

Logical functions are basic building blocks in any business logic, and it's important to understand their behaviour to use them effectively. The functions `if`, `or`, `and`, as well as `toboolean` do some magic in the background that you should be aware of. Here a quick test for you, if any of the results surprise you, it's worth to continue reading:

```
a!map(
  "1": if(null, true, false),
  "2": if({}, true, false),
  "3": if({true, false}, true, false),
  "4": if(false, true, false, 1, 2),
  "5": or(null), 
  "6": or({}),
  "7": and(null),
  "8": toboolean(0),
  "9": toboolean(1),
  "10": toboolean(-1)
)
```

The results are in :)

```
a!map(
  '1': false,
  '2': {},
  '3': {true, false},
  '4': 2,
  '5': false,
  '6': false,
  '7': true,
  '8': false,
  '9': true,
  '10': true
)
```

## The if Function

Probably, the first statement was trivial as we often come across this case. Null values are considered to be false. This is actually only true in the case of the `if` statement, otherwise null is always handled separately as we will see in a bit.

For the second and third statement we already have to look deeper into the documentation since the function definition in the Appian designer doesn't cover this behaviour. In the [docs](https://docs.appian.com/suite/help/23.1/fnc_logical_if.html) we discover that the if statement can work with lists as conditions. That can be super helpful, but it's also something to watch out for as this implicit behaviour can also lead to bugs that are not as obvious.

I included statement four just as an Easter egg as it's not covered in the documentation at all. It's possible to write nested `if` statements like this, but since it's not officially documented, you should always prefer `a!match`

## The and/or Function

With our knowledge from the `if`, we are now ready to tackle `and` and `or`. Statement five makes sense: If null is false, `or(null)` will be false too, but then looking at `and(null)` we start scratching our heads. Shouldn't this be false too? What is going on here?

Again, this behaviour is only described in the more detailed documentation (see [and](https://docs.appian.com/suite/help/23.1/fnc_logical_and.html)/[or](https://docs.appian.com/suite/help/23.1/fnc_logical_or.html)). Under the hood these functions remove all null values before evaluating. For the `or` an empty list is evaluated to false and for `and` to true. Keeping this in mind is important as it can easily lead to some unintuitive results:

```
a!localVariables: {
    local!people: {
        a!map(
            name: "Peter",
            isAdult: true
        ),
        a!map(
            name: "Ryan",
            isAdult: null
        )
    },
    local!everyoneIsAdult: and(local!people.isAdult)
}
```

This would evaluate to `true`, although I think the intuitive result should be `false` or `null`. One way to avoid this, is to use a comparison `and(toboolean(local!people.isAdult) = true)` or to ensure that the data is well defined.

## The toboolean Function

I included this function as we use it like above without knowing how values are parsed by `toboolean`. In comparison, to the logical functions discussed before, this one comes with the complete documentation in the designer and describes quite a lot of ways on how it will parse a value and turns it into a boolean:

> Converts a value or values to Boolean. toboolean(1) returns true. toboolean({1, 0}) returns {true, false}. Any text value beginning with "t" or "T", or any non-zero integer value, returns true. All other values return false.

## Conclusion

Overall, we can conclude that a closer view into Appian documentations, provides us with quite some extra bits of knowledge of functions we use day in, day out. I hoped you learned something and let me know in the comments if you were ever caught out by this behaviour of the logical functions.

[View full post](http://info.convedo.com/logical-functions-in-appian)

```json
{
  "@context" : "http://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Lukas Meihsner"
  },
  "dateModified" : "2025-09-01T13:34:52.309Z",
  "datePublished" : "2025-09-01T13:34:51Z",
  "headline" : "Logical Functions in Appian",
  "image" : {
    "@type" : "ImageObject",
    "height" : 1024,
    "url" : "https://244859.fs1.hubspotusercontent-na1.net/hubfs/244859/AI-Generated%20Media/Images/The%20image%20depicts%20a%20sleek%20modern%20interface%20of%20a%20lowcode%20software%20application%20emphasizing%20process%20automation%20and%20logical%20functions%20The%20screen%20displays%20a%20series%20of%20neatly%20organized%20code%20snippets%20and%20visual%20representations%20of%20functions%20like%20if%20or%20and%20an.png",
    "width" : 1024
  },
  "mainEntityOfPage" : "http://info.convedo.com/logical-functions-in-appian",
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "height" : 60.0,
      "url" : "https://connect.convedo.com/hubfs/Convedo%20green%20&%20blue.png",
      "width" : 275.19818
    },
    "name" : "Let's talk Process and Automation"
  }
}
```