# Scope of $variable in Let statement in Calculated Field

**URL:** <https://the.fmsoup.org/t/scope-of-variable-in-let-statement-in-calculated-field/3155>\
**Category:** Questions\
**Tags:** scripting, variables\
**Created:** [October 19, 2022, 6:52pm UTC](https://the.fmsoup.org/t/scope-of-variable-in-let-statement-in-calculated-field/3155 "2022-10-19T18:52:19Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Malcolm](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/malcolm/32/196_2.png) [@Malcolm](https://the.fmsoup.org/u/Malcolm)\
**Post date:** [October 20, 2022, 3:40am UTC](https://the.fmsoup.org/t/scope-of-variable-in-let-statement-in-calculated-field/3155/9 "2022-10-20T03:40:32Z")

</div>

This is a bug that could have serious consequences. No-one wants to have values from field calculations bubbling up into their scripts.

It is an excellent reason to ensure that you limit the scope of your variables as tightly as possible. In your case, the variable $N can be more tightly scoped by removing the $ character, making it a calculation variable.

> [@About Claris Products Feedback and Bug reporting](https://the.fmsoup.org/t/about-claris-products-feedback-and-bug-reporting/37):
>
> Please report your feedback about Claris Products on Claris site so that your feedback and bug reports help the vendor improve the product. The soup does NOT report to Claris on your behalf. [Reporting product issues](https://community.claris.com/en/s/topic/0TO0H000008OQOGWA4/report-a-product-issue)

---

_[View the full topic](https://the.fmsoup.org/t/scope-of-variable-in-let-statement-in-calculated-field/3155)._
