# Referencing Json Type Attribute

**URL:** <https://forum.playcanvas.com/t/referencing-json-type-attribute/21858>\
**Category:** Help & Support\
**Created:** [September 10, 2021, 7:16pm UTC](https://forum.playcanvas.com/t/referencing-json-type-attribute/21858 "2021-09-10T19:16:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aperez440](https://forum.playcanvas.com/letter_avatar_proxy/v4/letter/a/3d9bf3/32.png) [@aperez440](https://forum.playcanvas.com/u/aperez440)\
**Post date:** [September 10, 2021, 7:16pm UTC](https://forum.playcanvas.com/t/referencing-json-type-attribute/21858/1 "2021-09-10T19:16:17Z")

</div>

I have a script attribute below that holds information for cards:

```javascript
GameplayManager.attributes.add('cardHandler', {
    type: 'json',
    schema: [
        {
        title: 'spawnObject',
        type: 'asset',
        assetType: 'template'
        },
        {
        title: 'Card Name',
        name: 'cardName',
        type: 'string',
        default: 'enterCardName'
        }, 
        {
        name: 'cardValue',
        type: 'number',
        default: 0
        }],
    array: true
});

```

Once I have those filled out, is there a way to instantiate each of those individually and if so how do I reference them?

---

<div class="post-metadata">

**Author:** ![aperez440](https://forum.playcanvas.com/letter_avatar_proxy/v4/letter/a/3d9bf3/32.png) [@aperez440](https://forum.playcanvas.com/u/aperez440)\
**Post date:** [September 10, 2021, 7:48pm UTC](https://forum.playcanvas.com/t/referencing-json-type-attribute/21858/2 "2021-09-10T19:48:09Z")

</div>

Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![yaustar](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/yaustar/32/2268_2.png) [@yaustar](https://forum.playcanvas.com/u/yaustar)\
**Post date:** [September 10, 2021, 8:36pm UTC](https://forum.playcanvas.com/t/referencing-json-type-attribute/21858/3 "2021-09-10T20:36:29Z")

</div>

You can iterate through the script attribute array and instantiate an instance from the template asset. Once the instance is created, you can set the card values to whatever you need to on the instance.
