# Unable to read/write to tags 2 directories up using '\[.\]/../../tag'

**URL:** <https://forum.inductiveautomation.com/t/unable-to-read-write-to-tags-2-directories-up-using-tag/68798>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [January 19, 2023, 4:33pm UTC](https://forum.inductiveautomation.com/t/unable-to-read-write-to-tags-2-directories-up-using-tag/68798 "2023-01-19T16:33:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Hyles](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/andrew_hyles/32/30004_2.png) [@Andrew\_Hyles](https://forum.inductiveautomation.com/u/Andrew_Hyles)\
**Post date:** [January 19, 2023, 4:33pm UTC](https://forum.inductiveautomation.com/t/unable-to-read-write-to-tags-2-directories-up-using-tag/68798/1 "2023-01-19T16:33:19Z")

</div>

Hello,

I have a script that was failing to read a tag that was in a folder 2 levels up from the triggering tag (change event). I confirmed in documentation that I should be able to do this by using '..' twice:

> Additionally, you can use " **..**" (two periods) to go back one folder from the current relative position, for example [.]../../tag allows you to reference a Tag that is two folders up.

I made a few test tags: There are 3 layers of folders. The bottom layer has a tag with a change event that attempts to write to a tag in one of the parent folders. When pointed up one level with the path '[.]../writeMe', it writes with no issue. When pointed up to the top level with '[.]../../writeMe', it fails to write.

Is there something that might be causing this to fail that I am missing? Is there a different syntax that can be used here, aside from using the full tag paths?

Thanks,  
Andrew

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/0/c05542e31b46e76d875751bbfdd51bd53c2863b2.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:** [January 19, 2023, 6:21pm UTC](https://forum.inductiveautomation.com/t/unable-to-read-write-to-tags-2-directories-up-using-tag/68798/2 "2023-01-19T18:21:27Z")

</div>

I haven't built this folder structure out and tested this, but I'm pretty sure that you're second example is one level further than the path you were using.

`[.]../writeMe` is at the same level as the `Layer 3` folder. `[.]../../writeMe` would be to a tag which was in the `Layer 1` folder, however, looking at your screen shot, the second `writeMe` tag is actually in the `Layers` folder. I believe the correct path would be `[.]../../../writeMe`.

---

<div class="post-metadata">

**Author:** ![Andrew\_Hyles](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/andrew_hyles/32/30004_2.png) [@Andrew\_Hyles](https://forum.inductiveautomation.com/u/Andrew_Hyles)\
**Post date:** [January 19, 2023, 11:40pm UTC](https://forum.inductiveautomation.com/t/unable-to-read-write-to-tags-2-directories-up-using-tag/68798/3 "2023-01-19T23:40:00Z")

</div>

Irose,

Good catch! thank you!

Unfortunately, I'm still unable to reach this tag after correcting the location. Please see below corrected structure and the script attempting the write:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/c/9c47b1d1a704a970b6e9f9254f0a02681ac4cc3e.png)

Thanks again,  
Andrew

---

<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:** [January 20, 2023, 12:55pm UTC](https://forum.inductiveautomation.com/t/unable-to-read-write-to-tags-2-directories-up-using-tag/68798/4 "2023-01-20T12:55:23Z")

</div>

I'm not sure. I set up this structure on a dev gateway and it worked as expected.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/d/3dcbad0b9571e17c4f5b320b030b1a663a4ad744.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/9/09c905497b337f06765b6244a700dc775524ec5f.png)

I will note, however, that the best way to write this script would be to combine the writes into one.

```auto
def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):
	system.tag.writeBlocking(['[.]../writeMe','[.]../../writeMe'],['Layer 2','Layer 1'])

```

This server was using V8.1.20, so may not be a one to one with what you have.

If you open the diagnostics view on the Tag Editor, is there any error reported?

Might be worth having support poke around.

---

<div class="post-metadata">

**Author:** ![Andrew\_Hyles](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/andrew_hyles/32/30004_2.png) [@Andrew\_Hyles](https://forum.inductiveautomation.com/u/Andrew_Hyles)\
**Post date:** [January 20, 2023, 6:12pm UTC](https://forum.inductiveautomation.com/t/unable-to-read-write-to-tags-2-directories-up-using-tag/68798/5 "2023-01-20T18:12:07Z")

</div>

Thanks again for your help Irose.

When I loaded the project this morning, this was working exactly as expected. I'm not sure why it was giving me so much trouble previously...
