# EmbeddedView : Change of view with a script

**URL:** <https://forum.inductiveautomation.com/t/embeddedview-change-of-view-with-a-script/58928>\
**Category:** Ignition\
**Tags:** scripting, perspective\
**Created:** [April 27, 2022, 2:54pm UTC](https://forum.inductiveautomation.com/t/embeddedview-change-of-view-with-a-script/58928 "2022-04-27T14:54:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Valerian\_LADIEU](https://avatars.discourse-cdn.com/v4/letter/v/53a042/32.png) [@Valerian\_LADIEU](https://forum.inductiveautomation.com/u/Valerian_LADIEU)\
**Post date:** [April 27, 2022, 2:54pm UTC](https://forum.inductiveautomation.com/t/embeddedview-change-of-view-with-a-script/58928/1 "2022-04-27T14:54:21Z")

</div>

Hello everyone,

I’m having trouble with a view appearing

I created a scipt allowing me to retrieve the post name according to the folders of my sites  
So Script = “PDL” or “PDL PTR 1”

according to this value, I would like to display the view that goes with what is in the “security” folder  
(on the second screen)

So I wanted to know if there was a function already defined or how I could do?

Thank you 🙂

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/3/036d53a6e964b95f83a930f38f227e6540de070c.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/5/c53789ec6f50b730b2cb2ab1b3e6e81e16f73da7.png)

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [April 27, 2022, 3:04pm UTC](https://forum.inductiveautomation.com/t/embeddedview-change-of-view-with-a-script/58928/2 "2022-04-27T15:04:45Z")

</div>

I’m assuming this is a binding on the `props.path`.

The path has to be fully qualified, not just the name of the view so the result of your script needs to have the full folder structure included.

Assuming that `Securite` is a folder under the `Views` folder then the returned path would need to be

```auto
Securite/sec_mul/PDL

```

or

```auto
Securite/sec_mul/PDL PTR 1

```

---

<div class="post-metadata">

**Author:** ![Valerian\_LADIEU](https://avatars.discourse-cdn.com/v4/letter/v/53a042/32.png) [@Valerian\_LADIEU](https://forum.inductiveautomation.com/u/Valerian_LADIEU)\
**Post date:** [April 27, 2022, 3:24pm UTC](https://forum.inductiveautomation.com/t/embeddedview-change-of-view-with-a-script/58928/3 "2022-04-27T15:24:11Z")

</div>

Yes, it’s a binding on props.path

I will use as path:  
“/Securite”+"/sec\_mul"+"/"+Script

But to bring up the view, I have to use a specific function?

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [April 27, 2022, 3:25pm UTC](https://forum.inductiveautomation.com/t/embeddedview-change-of-view-with-a-script/58928/4 "2022-04-27T15:25:35Z")

</div>

No, if the path is valid, so long as it isn’t referencing the parent view, the embedded view should display the view the path points to.

---

<div class="post-metadata">

**Author:** ![Valerian\_LADIEU](https://avatars.discourse-cdn.com/v4/letter/v/53a042/32.png) [@Valerian\_LADIEU](https://forum.inductiveautomation.com/u/Valerian_LADIEU)\
**Post date:** [April 27, 2022, 3:42pm UTC](https://forum.inductiveautomation.com/t/embeddedview-change-of-view-with-a-script/58928/5 "2022-04-27T15:42:25Z")

</div>

It refers to the good path, but does not views sight…

I am surely making a mistake

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/a/fa8bcefedeb19608f4b643db39b719866fa0d091.png)

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [April 28, 2022, 6:15am UTC](https://forum.inductiveautomation.com/t/embeddedview-change-of-view-with-a-script/58928/6 "2022-04-28T06:15:43Z")

</div>

Make sure the page is configured with that path  
[https://docs.inductiveautomation.com/display/DOC81/Pages+in+Perspective](https://docs.inductiveautomation.com/display/DOC81/Pages+in+Perspective)  
Then you should be able to navigate to it  
[https://docs.inductiveautomation.com/display/DOC81/system.perspective.navigate](https://docs.inductiveautomation.com/display/DOC81/system.perspective.navigate)

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [April 28, 2022, 8:13am UTC](https://forum.inductiveautomation.com/t/embeddedview-change-of-view-with-a-script/58928/7 "2022-04-28T08:13:48Z")

</div>

I thought he was trying to change the path of an embedded view…

@Valerian_LADIEU  
What you’re trying to do is not clear, maybe try explaining in french what your goal is ?  
By the way, I sent you a pm the other day. I believe we’re working on the same solar farms !

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [April 28, 2022, 8:16am UTC](https://forum.inductiveautomation.com/t/embeddedview-change-of-view-with-a-script/58928/8 "2022-04-28T08:16:49Z")

</div>

ah yes my bad xd

---

<div class="post-metadata">

**Author:** ![Valerian\_LADIEU](https://avatars.discourse-cdn.com/v4/letter/v/53a042/32.png) [@Valerian\_LADIEU](https://forum.inductiveautomation.com/u/Valerian_LADIEU)\
**Post date:** [April 28, 2022, 9:40am UTC](https://forum.inductiveautomation.com/t/embeddedview-change-of-view-with-a-script/58928/10 "2022-04-28T09:40:42Z")

</div>

Its good  
I was only using a / at first and it doesn’t have to be
