# Detect preview mode

**URL:** <https://forum.inductiveautomation.com/t/detect-preview-mode/16334>\
**Category:** Ignition\
**Created:** [December 15, 2017, 1:31pm UTC](https://forum.inductiveautomation.com/t/detect-preview-mode/16334 "2017-12-15T13:31:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Claus\_Nielsen](https://avatars.discourse-cdn.com/v4/letter/c/77aa72/32.png) [@Claus\_Nielsen](https://forum.inductiveautomation.com/u/Claus_Nielsen)\
**Post date:** [December 15, 2017, 1:31pm UTC](https://forum.inductiveautomation.com/t/detect-preview-mode/16334/1 "2017-12-15T13:31:33Z")

</div>

Just a quick question.  
Is there anyway to detect preview mode in scripts? Something like this

```auto
if inPreviewMode:
    doSomething()

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 15, 2017, 2:03pm UTC](https://forum.inductiveautomation.com/t/detect-preview-mode/16334/2 "2017-12-15T14:03:23Z")

</div>

Yes. See [system.util.getSystemFlags()](https://docs.inductiveautomation.com/display/DOC79/system.util.getSystemFlags).

---

<div class="post-metadata">

**Author:** ![Claus\_Nielsen](https://avatars.discourse-cdn.com/v4/letter/c/77aa72/32.png) [@Claus\_Nielsen](https://forum.inductiveautomation.com/u/Claus_Nielsen)\
**Post date:** [December 15, 2017, 2:10pm UTC](https://forum.inductiveautomation.com/t/detect-preview-mode/16334/3 "2017-12-15T14:10:06Z")

</div>

Thank you very much.

---

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [June 10, 2022, 5:29pm UTC](https://forum.inductiveautomation.com/t/detect-preview-mode/16334/4 "2022-06-10T17:29:45Z")

</div>

Any ideas on how to do the equivalent in Perspective? I know the designer can tell when you are/are not because of how it handles click interactions with the page, but I am not sure if Perspective itself is able to tell in any way.

Would be a nice feature to have in the session props if not.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 10, 2022, 6:12pm UTC](https://forum.inductiveautomation.com/t/detect-preview-mode/16334/5 "2022-06-10T18:12:09Z")

</div>

IIRC, there are a number of session props that only work in a real Perspective client. Look at those.

---

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [June 10, 2022, 6:19pm UTC](https://forum.inductiveautomation.com/t/detect-preview-mode/16334/6 "2022-06-10T18:19:44Z")

</div>

Yeah I can use a couple to determine if I am in a designer or if I am in a browser/app, but nothing to show Preview mode or not. At least nothing immediately visible in the session props.
