# Keychain Expression

**URL:** <https://forum.inductiveautomation.com/t/keychain-expression/17500>\
**Category:** Ignition\
**Created:** [March 26, 2018, 5:39pm UTC](https://forum.inductiveautomation.com/t/keychain-expression/17500 "2018-03-26T17:39:07Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rgarcher](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@rgarcher](https://forum.inductiveautomation.com/u/rgarcher)\
**Post date:** [March 26, 2018, 5:39pm UTC](https://forum.inductiveautomation.com/t/keychain-expression/17500/1 "2018-03-26T17:39:07Z")

</div>

I’m trying to use a simple keychain expression that checks the value of a boolean and returns yes or no to the report. When I run the report, the expression doesn’t seem to evaluate. I’ve placed it below.

@manual\_entry == “true”?“Yes”:“No”@

I’ve tried testing for both “true” and “1” with no success. This seems like a bug. I’m using version 7.9.5.

---

<div class="post-metadata">

**Author:** ![jbowers](https://avatars.discourse-cdn.com/v4/letter/j/e47774/32.png) [@jbowers](https://forum.inductiveautomation.com/u/jbowers)\
**Post date:** [March 26, 2018, 5:42pm UTC](https://forum.inductiveautomation.com/t/keychain-expression/17500/2 "2018-03-26T17:42:58Z")

</div>

I am having similar issues but with basic arithmetic rather than ternary operators.

‘+’ concatenates ints, ‘-’ returns N/A with ints, ‘\*’ returns N/A with ints

---

<div class="post-metadata">

**Author:** ![jbowers](https://avatars.discourse-cdn.com/v4/letter/j/e47774/32.png) [@jbowers](https://forum.inductiveautomation.com/u/jbowers)\
**Post date:** [March 26, 2018, 5:50pm UTC](https://forum.inductiveautomation.com/t/keychain-expression/17500/3 "2018-03-26T17:50:16Z")

</div>

My mistake, the person that made our database apparently entered everything in as a varchar

---

<div class="post-metadata">

**Author:** ![rgarcher](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@rgarcher](https://forum.inductiveautomation.com/u/rgarcher)\
**Post date:** [March 26, 2018, 6:00pm UTC](https://forum.inductiveautomation.com/t/keychain-expression/17500/4 "2018-03-26T18:00:52Z")

</div>

To clarify, I’m reading a value from a SQL database that is a “bit” type. When I run the report without the expression, the values “true” and “false” are returned.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 26, 2018, 6:06pm UTC](https://forum.inductiveautomation.com/t/keychain-expression/17500/5 "2018-03-26T18:06:19Z")

</div>

Try a “1” but without any quotes.

---

<div class="post-metadata">

**Author:** ![rgarcher](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@rgarcher](https://forum.inductiveautomation.com/u/rgarcher)\
**Post date:** [March 26, 2018, 6:12pm UTC](https://forum.inductiveautomation.com/t/keychain-expression/17500/6 "2018-03-26T18:12:18Z")

</div>

I’ve tried that as well with no success. Yes is returned every time with the data source changing between true and false.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 26, 2018, 6:14pm UTC](https://forum.inductiveautomation.com/t/keychain-expression/17500/7 "2018-03-26T18:14:19Z")

</div>

Try:

```auto
@manual_entry?"Yes":"No"@

```

---

<div class="post-metadata">

**Author:** ![rgarcher](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@rgarcher](https://forum.inductiveautomation.com/u/rgarcher)\
**Post date:** [March 26, 2018, 6:15pm UTC](https://forum.inductiveautomation.com/t/keychain-expression/17500/8 "2018-03-26T18:15:35Z")

</div>

Perfect. That worked. Thanks!

---

<div class="post-metadata">

**Author:** ![Brian](https://avatars.discourse-cdn.com/v4/letter/b/97f17d/32.png) [@Brian](https://forum.inductiveautomation.com/u/Brian)\
**Post date:** [March 26, 2018, 6:23pm UTC](https://forum.inductiveautomation.com/t/keychain-expression/17500/9 "2018-03-26T18:23:10Z")

</div>

I’m thinking this example needs to be added to the documentation. I was tripped up by this same thing a few weeks ago.

I was about to chime in, but you beat me to it. 🙂
