# If node not working as expected

**URL:** <https://forum.dynamobim.com/t/if-node-not-working-as-expected/42112>\
**Category:** Uncategorized\
**Created:** [October 21, 2019, 12:34pm UTC](https://forum.dynamobim.com/t/if-node-not-working-as-expected/42112 "2019-10-21T12:34:22Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![TheMattatonAP](https://avatars.discourse-cdn.com/v4/letter/t/c2a13f/32.png) [@TheMattatonAP](https://forum.dynamobim.com/u/TheMattatonAP)\
**Post date:** [October 21, 2019, 2:52pm UTC](https://forum.dynamobim.com/t/if-node-not-working-as-expected/42112/21 "2019-10-21T14:52:25Z")

</div>

I think I figured it out. So much simpler. 🙂

 ![simplified](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/7/47d88cdd97e4dc7fc967fc70adb5307cf6dc7a42.png)

---

<div class="post-metadata">

**Author:** ![TheMattatonAP](https://avatars.discourse-cdn.com/v4/letter/t/c2a13f/32.png) [@TheMattatonAP](https://forum.dynamobim.com/u/TheMattatonAP)\
**Post date:** [October 21, 2019, 2:55pm UTC](https://forum.dynamobim.com/t/if-node-not-working-as-expected/42112/22 "2019-10-21T14:55:46Z")

</div>

Simplified further:  
A;  
B=30;  
C = [Imperative]  
{  
if (A \> B) {  
return A.substring(0,B);  
}  
else  
{  
return A;  
}  
};

---

<div class="post-metadata">

**Author:** ![Daan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/daan/32/82246_2.png) [@Daan](https://forum.dynamobim.com/u/Daan)\
**Post date:** [October 21, 2019, 3:52pm UTC](https://forum.dynamobim.com/t/if-node-not-working-as-expected/42112/23 "2019-10-21T15:52:09Z")

</div>

Good to hear you have a working solution 🙂

Just make sure you mark your solution as “solution” so that others with this problem can find it easily!

[Previous page](https://forum.dynamobim.com/t/if-node-not-working-as-expected/42112.md?page=1)
