# Using "system.tag.Browse" to create a tag array of full paths

**URL:** <https://forum.inductiveautomation.com/t/using-system-tag-browse-to-create-a-tag-array-of-full-paths/99235>\
**Category:** Ignition\
**Tags:** ignition81, vision, scripting\
**Created:** [November 28, 2024, 3:38pm UTC](https://forum.inductiveautomation.com/t/using-system-tag-browse-to-create-a-tag-array-of-full-paths/99235 "2024-11-28T15:38:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AdrielP](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@AdrielP](https://forum.inductiveautomation.com/u/AdrielP)\
**Post date:** [November 28, 2024, 3:38pm UTC](https://forum.inductiveautomation.com/t/using-system-tag-browse-to-create-a-tag-array-of-full-paths/99235/1 "2024-11-28T15:38:10Z")

</div>

Hi there, I'm having a bit of a nuisance using the tag browse function.

Essentially, I wish to create 2 arrays, one with the full path of my plc tags and one with the values of my client tags. I need these 2 arrays to line up so that I can write all my values at once.

My problem is that, even though both tag folders contain the same amount of tags with the same names, when I browse my Client tag folder the first 2 tags come back out of order (instead of [tag1, tag2...] in the array, it prints [tag2, tag1...]. I don't understand why this is happening, every other tag seems to be in the right order and properly lining up with the PLC tag folder browse.

I'd appreciate any help in the matter, thanks.

This is what my code looks like:

PLCRecipe\_Tags = system.tag.browse("[PLC]gstActiveRecipe")  
ClientRecipe\_Tags = system.tag.browse("[client]ActiveRecipe")

ClientTags =   
PLCtags =

for PLCTag\_Path in PLCRecipe\_Tags.getResults():  
tagPath =str(PLCTag\_Path["fullPath"])  
PLCtags.append(tagPath)

for ClientTag\_Path in ClientRecipe\_Tags.getResults():  
tagPath = str(ClientTag\_Path["fullPath"])  
ClientTags.append(tagPath)

print(ClientTags)  
print(PLCtags)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 28, 2024, 3:42pm UTC](https://forum.inductiveautomation.com/t/using-system-tag-browse-to-create-a-tag-array-of-full-paths/99235/2 "2024-11-28T15:42:56Z")

</div>

You could sort both lists after creating them so that you don't depend on the ordering of the browse functions.

---

<div class="post-metadata">

**Author:** ![AdrielP](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@AdrielP](https://forum.inductiveautomation.com/u/AdrielP)\
**Post date:** [November 28, 2024, 3:53pm UTC](https://forum.inductiveautomation.com/t/using-system-tag-browse-to-create-a-tag-array-of-full-paths/99235/3 "2024-11-28T15:53:37Z")

</div>

Could you refer me to an example of using a sorting function for an array? So far I've found this "system.dataset.sort" but it seems to be used mainly with tables.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 28, 2024, 3:55pm UTC](https://forum.inductiveautomation.com/t/using-system-tag-browse-to-create-a-tag-array-of-full-paths/99235/4 "2024-11-28T15:55:17Z")

</div>

Python lists have a `sort()` method:

```python
>>> a = ["c", "a", "b"]
>>> a.sort()
>>> a
['a', 'b', 'c']
```

---

<div class="post-metadata">

**Author:** ![AdrielP](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@AdrielP](https://forum.inductiveautomation.com/u/AdrielP)\
**Post date:** [November 28, 2024, 4:05pm UTC](https://forum.inductiveautomation.com/t/using-system-tag-browse-to-create-a-tag-array-of-full-paths/99235/5 "2024-11-28T16:05:58Z")

</div>

Thank you, this worked! 🙂
