# Read and write to the view.json

**URL:** <https://forum.inductiveautomation.com/t/read-and-write-to-the-view-json/96184>\
**Category:** Module Development\
**Tags:** perspective, ignition81\
**Created:** [September 19, 2024, 1:36pm UTC](https://forum.inductiveautomation.com/t/read-and-write-to-the-view-json/96184 "2024-09-19T13:36:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon28080652](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@anon28080652](https://forum.inductiveautomation.com/u/anon28080652)\
**Post date:** [September 19, 2024, 1:36pm UTC](https://forum.inductiveautomation.com/t/read-and-write-to-the-view-json/96184/1 "2024-09-19T13:36:43Z")

</div>

Hello everyone,

i need your help with the following task. I would like to read the “view.json” files from the gateway’s project directory. More specifically, I would like to read the parameters and permissions from existing views in a project and write them to an XML file. I have already come across the "ViewConfig" of the com.inductive.perspective.common.config. However, I despair about the command “fromProjectResource(ProjectResource resource, com.inductiveautomation.ignition.common.gson.Gson gson)”. How do I have to initialize and pass the Gson or how do I use this command?

Following is my previous code:

 ![Code](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/d/9d7612690a723f46c1001a5c442d0ea2174384c4.png)  
I use this Code in the Gateway scope.

Thanks for your help!

---

<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:** [September 19, 2024, 2:39pm UTC](https://forum.inductiveautomation.com/t/read-and-write-to-the-view-json/96184/2 "2024-09-19T14:39:56Z")

</div>

i dont know if its any usefull, but i accessed views (aswell as one that accesses this for vision (older version though)) through this. though it didnt really have anything to do with permissions so i have no idea if you can find anything usefull here.

> [@Export all component text used in Ignition](https://forum.inductiveautomation.com/t/export-all-component-text-used-in-ignition/53668/4):
>
> Here is a script i used to automatically add all text values to the translate manager in perspective By checking the resource files… warning this may take a while xd import os import json from com.inductiveautomation.ignition.gateway import IgnitionGateway from com.inductiveautomation.ignition.gateway.script import GatewaySystemUtilities package = IgnitionGateway.get().getLocalizationManager().loadFullPackage() oldKeys = package.getAvailableKeys() context = IgnitionGateway.get() path…

---

<div class="post-metadata">

**Author:** ![anon28080652](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@anon28080652](https://forum.inductiveautomation.com/u/anon28080652)\
**Post date:** [September 20, 2024, 1:52pm UTC](https://forum.inductiveautomation.com/t/read-and-write-to-the-view-json/96184/3 "2024-09-20T13:52:46Z")

</div>

Thank you for the answer. In fact, I'm currently accessing the parameters in the ".json" via a path. However, there is certainly a more elegant solution for this using the object "ViewConfig" and the "getParamDefinitions" method. However, as I said, I don't know how to initialize the "Gson" object and pass it to the "fromProjectResource" method. I've already tried "PerspectiveModule.createPerspectiveCompatibleGson()", unfortunately without success.
