# What is the best way to debug formulas?

**URL:** <https://community.weweb.io/t/what-is-the-best-way-to-debug-formulas/15294>\
**Category:** Tips and Hacks\
**Created:** [January 9, 2025, 11:03pm UTC](https://community.weweb.io/t/what-is-the-best-way-to-debug-formulas/15294 "2025-01-09T23:03:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![boost](https://avatars.discourse-cdn.com/v4/letter/b/8e8cbc/32.png) [@boost](https://community.weweb.io/u/boost)\
**Post date:** [January 9, 2025, 11:03pm UTC](https://community.weweb.io/t/what-is-the-best-way-to-debug-formulas/15294/1 "2025-01-09T23:03:50Z")

</div>

![Screenshot 2025-01-09 150320](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/f/f26a58a7515be1ec6d70e9309aeb022375326e68.png)

For example, if I just wanted to debug only a section of my formula, do I have to take apart the whole formula just to isolate the expression?

---

<div class="post-metadata">

**Author:** ![sam1](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/sam1/32/6724_2.png) [@sam1](https://community.weweb.io/u/sam1)\
**Post date:** [January 10, 2025, 1:08am UTC](https://community.weweb.io/t/what-is-the-best-way-to-debug-formulas/15294/2 "2025-01-10T01:08:05Z")

</div>

Thats typicaly how I do it I find if the forumla is any more complicated then what you have written there I will use js to segment it out more.

looking at your code I think your missing some brackets thought as the or is only looking at the first expression after it. which is the roundDownToDay(). what you want I think is or (roundDownToDay()!= roundDownToDay())

---

<div class="post-metadata">

**Author:** ![boost](https://avatars.discourse-cdn.com/v4/letter/b/8e8cbc/32.png) [@boost](https://community.weweb.io/u/boost)\
**Post date:** [January 10, 2025, 1:34am UTC](https://community.weweb.io/t/what-is-the-best-way-to-debug-formulas/15294/3 "2025-01-10T01:34:04Z")

</div>

Ahh, thank you. Actually my formula was working, but for some reason when I switch the order to “roundDownToDay…” or “item.index=0”, the “roundDownToDay…” gets an error on repeatedItems index 0 because there is no item for index -1.

This was difficult to isolate for me because this conditional was used as part of a conditional rendering for repeatedItems. So the element item with the value I wanted to check kept disappearing from the Weweb editor and there was no way to force the display
