# Perspective Custom Props losing Type

**URL:** <https://forum.inductiveautomation.com/t/perspective-custom-props-losing-type/82565>\
**Category:** Ignition\
**Tags:** ignition81, perspective, scripting\
**Created:** [November 30, 2023, 11:44pm UTC](https://forum.inductiveautomation.com/t/perspective-custom-props-losing-type/82565 "2023-11-30T23:44:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [November 30, 2023, 11:44pm UTC](https://forum.inductiveautomation.com/t/perspective-custom-props-losing-type/82565/1 "2023-11-30T23:44:21Z")

</div>

Hoping for a nudge, I want to return tag data for a specific path. The example below works in the Designer. Tag paths are `BasicTagPath` and values are `BasicQualifiedValue`. But, when I bind the results (using script transform) in a custom prop within Perspective everything seems to lose their type. For example the value is not a QV, it is the actual value or None/null if bad quality.

```auto
results = [tag for tag in system.tag.browse(tagPath, {"valueSource":"opc", "recursive":True})]

```

What am I missing?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 1, 2023, 2:05am UTC](https://forum.inductiveautomation.com/t/perspective-custom-props-losing-type/82565/2 "2023-12-01T02:05:00Z")

</div>

Anything assigned to a Perspective property is coerced into a type that is JSON compatible, or with a thin wrapper, because that's how they have to travel to the browser. And has been this way from day one.

This is one of the motivations for `sessionVarMap()`, `pageVarMap()`, and `viewVarMap()`, as implemented in my Integration Toolkit module. You can bring values into Perspective through those maps, and the Perspective side will be coerced, but a script can retrieve the values in their original jython/java glory.

(Though, having the equivalent of **page** custom properties was also a consideration. Two birds with one stone, and all that.)

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [December 1, 2023, 2:08am UTC](https://forum.inductiveautomation.com/t/perspective-custom-props-losing-type/82565/3 "2023-12-01T02:08:14Z")

</div>

Hey Phil, just to make sure I'm understanding, `BasicTagPath` and/or `BasicQualifiedValue` are not JSON compatible types?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 1, 2023, 2:12am UTC](https://forum.inductiveautomation.com/t/perspective-custom-props-losing-type/82565/4 "2023-12-01T02:12:03Z")

</div>

Nope. You get:

- Strings
- Numbers
- Arrays
- Mappings { But the keys must be proper javascript identifiers }
- Datasets { not native to JSON, but implemented as a light wrapper with the above }

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [December 1, 2023, 2:15am UTC](https://forum.inductiveautomation.com/t/perspective-custom-props-losing-type/82565/5 "2023-12-01T02:15:02Z")

</div>

Thank you. Good info to know.
