# Bitwise operation in conditional node

**URL:** <https://forums.losant.com/t/bitwise-operation-in-conditional-node/5485>\
**Category:** Help\
**Tags:** conditional\
**Created:** [June 6, 2024, 3:52am UTC](https://forums.losant.com/t/bitwise-operation-in-conditional-node/5485 "2024-06-06T03:52:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Santoso](https://avatars.discourse-cdn.com/v4/letter/d/c0e974/32.png) [@David\_Santoso](https://forums.losant.com/u/David_Santoso)\
**Post date:** [June 6, 2024, 3:52am UTC](https://forums.losant.com/t/bitwise-operation-in-conditional-node/5485/1 "2024-06-06T03:52:41Z")

</div>

Hi,

Is there a way to use bitwise operations in the conditional node? We have a status word that needs to be decoded bit by bit. I was able to use bit-shifting operations, but that only works if the upper bits are either zero or have a known value.

Thanks,  
David

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [June 6, 2024, 2:36pm UTC](https://forums.losant.com/t/bitwise-operation-in-conditional-node/5485/2 "2024-06-06T14:36:14Z")

</div>

Hey @David_Santoso,

You’ll likely have to use a [Function Node](https://docs.losant.com/workflows/logic/function/) to parse the status value into separate values on the payload. JavaScript does have a number of [bitwise operators](https://www.w3schools.com/js/js_bitwise.asp) that can be used to extract the values at each bit.

---

<div class="post-metadata">

**Author:** ![Stewart\_McCallum](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/stewart_mccallum/32/2490_2.png) [@Stewart\_McCallum](https://forums.losant.com/u/Stewart_McCallum)\
**Post date:** [June 6, 2024, 9:34pm UTC](https://forums.losant.com/t/bitwise-operation-in-conditional-node/5485/3 "2024-06-06T21:34:49Z")

</div>

Ive used a function node to convert hex values to bin, then array nodes to pick out the bit flags of intrest.

---

<div class="post-metadata">

**Author:** ![David\_Santoso](https://avatars.discourse-cdn.com/v4/letter/d/c0e974/32.png) [@David\_Santoso](https://forums.losant.com/u/David_Santoso)\
**Post date:** [June 8, 2024, 5:33pm UTC](https://forums.losant.com/t/bitwise-operation-in-conditional-node/5485/5 "2024-06-08T17:33:49Z")

</div>

Thank you @Brandon_Cannaday and @Stewart_McCallum, I was able to do bitwise operations using the Function Node.

Best,  
David
