# Exports all tags as json from GatewayContext

**URL:** <https://forum.inductiveautomation.com/t/exports-all-tags-as-json-from-gatewaycontext/78288>\
**Category:** Module Development\
**Created:** [August 23, 2023, 2:10pm UTC](https://forum.inductiveautomation.com/t/exports-all-tags-as-json-from-gatewaycontext/78288 "2023-08-23T14:10:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan\_Maranda](https://avatars.discourse-cdn.com/v4/letter/j/8e8cbc/32.png) [@Jonathan\_Maranda](https://forum.inductiveautomation.com/u/Jonathan_Maranda)\
**Post date:** [August 23, 2023, 2:10pm UTC](https://forum.inductiveautomation.com/t/exports-all-tags-as-json-from-gatewaycontext/78288/1 "2023-08-23T14:10:00Z")

</div>

Hi,

I want to export all tags from all the providers as a json file from a gateway scope. The goal is to have the same file layout as the file generated by the "Export tags" button in the designer. Thanks

So far, i have this code :

```auto
for (TagProvider tagProvider : gatewayContext.getTagManager().getTagProviders()) {
		Results<NodeDescription> r = tagProvider.browseAsync(tagPath, BrowseFilter.NONE).get(30, TimeUnit.SECONDS);
	}

```

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [August 23, 2023, 9:19pm UTC](https://forum.inductiveautomation.com/t/exports-all-tags-as-json-from-gatewaycontext/78288/2 "2023-08-23T21:19:27Z")

</div>

What happens when you run your code?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 23, 2023, 9:57pm UTC](https://forum.inductiveautomation.com/t/exports-all-tags-as-json-from-gatewaycontext/78288/3 "2023-08-23T21:57:27Z")

</div>

Probably the easiest thing to do would be to call into the scripting system, believe it or not. The implementation of this function is non-trivial.

If you insist, you'll want to use `getTagConfigsAsync`, not `browseAsync`, and `com.inductiveautomation.ignition.common.tags.TagUtilities#toJsonObject`.
