# Search all folder in Tag Provider or within another Folder

**URL:** <https://forum.inductiveautomation.com/t/search-all-folder-in-tag-provider-or-within-another-folder/23374>\
**Category:** Ignition\
**Created:** [March 15, 2019, 10:56am UTC](https://forum.inductiveautomation.com/t/search-all-folder-in-tag-provider-or-within-another-folder/23374 "2019-03-15T10:56:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasko](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@jasko](https://forum.inductiveautomation.com/u/jasko)\
**Post date:** [March 15, 2019, 10:56am UTC](https://forum.inductiveautomation.com/t/search-all-folder-in-tag-provider-or-within-another-folder/23374/1 "2019-03-15T10:56:09Z")

</div>

Hello everybody,

I’m working on a script to get all the folders in a tag provider, and it’s going fine. I’ve prepared a script, but I do not know if there might be any side effects I’m not aware of. So I ask you for your opinion.

```auto
def getAllFolder(self, pPath):
        from time import sleep
	if not isinstance(pPath, list):
		pPath = [pPath]
	lFolder = []
	lFolders = [None for _ in pPath]
	for i, folder in enumerate(pPath):
		def search(i=i, folder=folder):
			lFolders[i] = system.tag.browseTags(	parentPath=folder,
											tagPath='*',
											tagType='Folder',
											recursive=False,
											sort='ASC')
		system.util.invokeAsynchronous(search)
	
	# join threads called with system.util.invokeAsynchronous(search)
	while None in lFolders:
		sleep(0.01)
	
	for lf in lFolders:
		for f in lf:
			lFolder.append(f.fullPath)
	
	if len(lFolder) == 0:
		return []
	
	lFolder += self.getAllFolder(lFolder)
	return lFolder

```

The script is not running on a gateway scope, only client scope.
