# Can't you acces class gateway.model.ComponentModel in script

**URL:** <https://forum.inductiveautomation.com/t/cant-you-acces-class-gateway-model-componentmodel-in-script/50093>\
**Category:** Ignition\
**Tags:** perspective, scripting\
**Created:** [August 19, 2021, 12:13pm UTC](https://forum.inductiveautomation.com/t/cant-you-acces-class-gateway-model-componentmodel-in-script/50093 "2021-08-19T12:13:06Z")\
**Posts on this page:** 1\
**Showing post:** 10

<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:** [August 23, 2021, 7:14am UTC](https://forum.inductiveautomation.com/t/cant-you-acces-class-gateway-model-componentmodel-in-script/50093/10 "2021-08-23T07:14:06Z")

</div>

i can use this too thx!

> [@Please add ids to perspective components for writing tests](https://forum.inductiveautomation.com/t/please-add-ids-to-perspective-components-for-writing-tests/46949/16):
>
> Actually, Cody’s script above can be adapted to be a bit less fragile without too much trouble. client = \_\_client mounts = \_\_client.mounts mainViewId = `${mounts.center.viewPath}@${mounts.center.code}` mainView = client.page.views.get(mainViewId) mainView.custom.read("key") // or readArray, readDataset, etc Still somewhat fragile, but not as bad. PropertyTree on the frontend has various methods to read values from the model as different types. Custom properties are currently ‘synced’ to the fr…

---

_[View the full topic](https://forum.inductiveautomation.com/t/cant-you-acces-class-gateway-model-componentmodel-in-script/50093)._
