# Initialize Values on vision window

**URL:** <https://forum.inductiveautomation.com/t/initialize-values-on-vision-window/34010>\
**Category:** Ignition\
**Created:** [April 17, 2020, 2:48pm UTC](https://forum.inductiveautomation.com/t/initialize-values-on-vision-window/34010 "2020-04-17T14:48:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bwhite](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bwhite/32/7112_2.png) [@bwhite](https://forum.inductiveautomation.com/u/bwhite)\
**Post date:** [April 17, 2020, 2:48pm UTC](https://forum.inductiveautomation.com/t/initialize-values-on-vision-window/34010/1 "2020-04-17T14:48:16Z")

</div>

What is the best way to initialize values on a vision window when it opens? I have used the visionWindowsOpened script, but it doesn’t always work the way I think it should.

---

<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:** [April 17, 2020, 3:00pm UTC](https://forum.inductiveautomation.com/t/initialize-values-on-vision-window/34010/2 "2020-04-17T15:00:29Z")

</div>

Where really necessary, I tend to use an expression binding that is just a constant. Only executes once when the component is started up.

---

<div class="post-metadata">

**Author:** ![Bastian\_Ignacio](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bastian_ignacio/32/43245_2.png) [@Bastian\_Ignacio](https://forum.inductiveautomation.com/u/Bastian_Ignacio)\
**Post date:** [February 14, 2023, 7:48pm UTC](https://forum.inductiveautomation.com/t/initialize-values-on-vision-window/34010/3 "2023-02-14T19:48:27Z")

</div>

> [@pturmel](#):
>
> expression binding

Hello Sir.

Can you explain that?  
I'm looking to tell the user "yes you have permission" and open home,  
or "sorry, you don't have permission, you must be an administrator"

I supposed use [System]Client/User/RolesString

many thanks

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [February 14, 2023, 7:56pm UTC](https://forum.inductiveautomation.com/t/initialize-values-on-vision-window/34010/4 "2023-02-14T19:56:52Z")

</div>

Have you taken the courses at inductive university? Highly recommend them.[https://www.inductiveuniversity.com/](https://www.inductiveuniversity.com/) to show you the basics of bindings.

You wouldn't want to use that tag directly. In a binding you could want to use `hasRole('administrator')` which would be true if the user had that role, false otherwise. Or in scripting you could do `if 'administrator' in system.user.getRoles():`

I don't know how much sense either of these will make though if you are not familiar with the general setup of Ignition. I highly recommend taking the courses in my first link.

---

<div class="post-metadata">

**Author:** ![Bastian\_Ignacio](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bastian_ignacio/32/43245_2.png) [@Bastian\_Ignacio](https://forum.inductiveautomation.com/u/Bastian_Ignacio)\
**Post date:** [February 14, 2023, 8:00pm UTC](https://forum.inductiveautomation.com/t/initialize-values-on-vision-window/34010/5 "2023-02-14T20:00:44Z")

</div>

Hello sir, yes I have been reading the courses while developing but I have not found something similar  
After pressing login, I look to open only if the user is admin... on Vision

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/d/ede9053a3e5c3bc2508f85da6cda0c5373319971.png)

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [February 14, 2023, 8:04pm UTC](https://forum.inductiveautomation.com/t/initialize-values-on-vision-window/34010/6 "2023-02-14T20:04:50Z")

</div>

Next time I would recommend making a new topic as this does not really relate to the original thread. But since you are here, under project properites you should see  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/4/4405741b3cb290182603ac3ee7d88b6efa9a4f58.png)

Put administrator in there.

---

<div class="post-metadata">

**Author:** ![Bastian\_Ignacio](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bastian_ignacio/32/43245_2.png) [@Bastian\_Ignacio](https://forum.inductiveautomation.com/u/Bastian_Ignacio)\
**Post date:** [February 14, 2023, 8:29pm UTC](https://forum.inductiveautomation.com/t/initialize-values-on-vision-window/34010/7 "2023-02-14T20:29:00Z")

</div>

Many thanks!

I hadn't really seen this before, not even in the tutorials

grateful!
