# Navigation item remains visible for teacher users

**URL:** <https://forum.klai.studio/t/navigation-item-remains-visible-for-teacher-users/1231>\
**Category:** Support\
**Created:** [September 3, 2026, 8:47pm UTC](https://forum.klai.studio/t/navigation-item-remains-visible-for-teacher-users/1231 "2026-09-03T20:47:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BetterForms](https://forum.klai.studio/user_avatar/forum.klai.studio/betterforms/32/295_2.png) [@BetterForms](https://forum.klai.studio/u/BetterForms)\
**Post date:** [September 3, 2026, 8:47pm UTC](https://forum.klai.studio/t/navigation-item-remains-visible-for-teacher-users/1231/1 "2026-09-03T20:47:37Z")

</div>

**Question:** Why does the `To Do` navigation item remain visible for users whose `accountType` is `teacher`, despite using a `visible_calc` condition?

**Answer:** The navigation calculation evaluator may not reliably support optional chaining (`?.`). Use a defensive expression instead, and normalize the value if necessary:

```json
"visible_calc": "String((app.HAM && app.HAM.accountType) || '').trim().toLowerCase() !== 'teacher'"

```

Also verify the runtime value in Dev Tools → App to ensure it is actually `teacher` and does not contain unexpected capitalization or whitespace.

* * *

### Original Slack Thread

````plaintext
User U09UK5V4VHB: we have this on our navigation
{
        "exact": 0,
        "icon": "fa fa-regular fa-clipboard-list",
        "label": "To Do",
        "path": "/todo",
        "styleClasses": "mb-2",
        "visible_calc": "String(app.HAM?.accountType || '').toLowerCase() !== 'teacher'"

and this still shows up for some user that are 'teacher'
User U0663T8PWG7: `visible_calc` is the right property, but I’d avoid optional chaining here. The navigation calc evaluator may not reliably handle `?.`, causing the condition to fall through.
Use a defensive expression without optional chaining:
```"visible_calc": "String((app.HAM &amp;&amp; app.HAM.accountType) || '').toLowerCase() !== 'teacher'"```
Also verify the runtime value in Dev Tools → App. If it’s something like `"Teacher "` or `"teacher\n"`, normalize whitespace too:
```"visible_calc": "String((app.HAM &amp;&amp; app.HAM.accountType) || '').trim().toLowerCase() !== 'teacher'"```

User UBBJX2EHM: Yeah, I’m not sure why that needs to be so complex with the lowercase, etc. If you’re just trying to match whether his teacher just do that teacher should not have mixed case anyway since it’s coming from the backend, you should know exactly what that variable looks like

````
