# Expression to color/StyleClass map transform example

**URL:** <https://forum.inductiveautomation.com/t/expression-to-color-styleclass-map-transform-example/34814>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [May 16, 2020, 9:14pm UTC](https://forum.inductiveautomation.com/t/expression-to-color-styleclass-map-transform-example/34814 "2020-05-16T21:14:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hunterdg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hunterdg/32/67774_2.png) [@hunterdg](https://forum.inductiveautomation.com/u/hunterdg)\
**Post date:** [May 16, 2020, 9:14pm UTC](https://forum.inductiveautomation.com/t/expression-to-color-styleclass-map-transform-example/34814/1 "2020-05-16T21:14:51Z")

</div>

Though I could certainly write a standalone expression binding, [this example in the documentation](https://docs.inductiveautomation.com/display/DOC80/Map+Transform#MapTransform-ExpressiontoColor) piqued my interest.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/9/9e432fb90caae9f775a5f64a5282a4959fafcba7.png)

Perhaps I'm completely misunderstanding the example (very possible), but I duplicated the transform and cannot get it to return anything but the fallback value.

> [...] the original value of the property binding is **15**. For each expression past the first, a single bit of that integer is being tested. **Since none of bits 0, 1, or 2 are true** , we get the fallback.

- 15 is 1111 in binary...
- What is the value of `Fault_Mask` in this example? 32768?
- How does any transform (checking for equality) between an **integer** (15) and a **boolean** (results of `getBit()` function) test single bits of the aforementioned integer? It's clearly not performing a bitwise AND between `Fault_Code` and `Fault_Mask`

I ended up swapping Fault\_Code and Fault\_Mask, setting Fault\_Mask to 1 and then the getBit() expression properly checked for bits in Fault\_Code.

 ![Screen Shot 2020-05-16 at 4.14.11 PM](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/a80889da9a7a02f3c985a9ec4de99dac495b8bdc.png)

On a side note, how is the map transform handled if the value matches multiple rows? Seems it tests all rows and returns the last row that matches - it does not stop after the first match. This does not seem to be specified in the documentation. Is this desired behavior?
