# Build memory tag to populate a complex prop in perspective (states in multistate button)

**URL:** <https://forum.inductiveautomation.com/t/build-memory-tag-to-populate-a-complex-prop-in-perspective-states-in-multistate-button/88411>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [April 5, 2024, 10:20am UTC](https://forum.inductiveautomation.com/t/build-memory-tag-to-populate-a-complex-prop-in-perspective-states-in-multistate-button/88411 "2024-04-05T10:20:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikolai\_Eskild\_Jense](https://avatars.discourse-cdn.com/v4/letter/n/a5b964/32.png) [@Nikolai\_Eskild\_Jense](https://forum.inductiveautomation.com/u/Nikolai_Eskild_Jense)\
**Post date:** [April 5, 2024, 10:20am UTC](https://forum.inductiveautomation.com/t/build-memory-tag-to-populate-a-complex-prop-in-perspective-states-in-multistate-button/88411/1 "2024-04-05T10:20:52Z")

</div>

Im trying to figure out how to format a memory tag so I can populate a multistate button. A generic multistate button i structured like so

`[{ "text": "Hand", "value": 1, "selectedStyle": { "classes": "", "backgroundColor": "#FFF275" }, "unselectedStyle": { "classes": "" } }, { "text": "Off", "value": 2, "selectedStyle": { "classes": "", "backgroundColor": "#F84553" }, "unselectedStyle": { "classes": "" } }, { "text": "Auto", "value": 3, "selectedStyle": { "classes": "", "backgroundColor": "#7CEA9C" }, "unselectedStyle": { "classes": "" } }]`  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/0/405b196ffc36e5bcdcee4b28cbc01c9f5677d5bb.png)

As far as i understand the memory tag has to hold a string array, but I cant seem to figure out how to format the items in the array. I feel like I've tried the most obvious ways already and I've begun plain guessing.

---

<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:** [April 5, 2024, 12:14pm UTC](https://forum.inductiveautomation.com/t/build-memory-tag-to-populate-a-complex-prop-in-perspective-states-in-multistate-button/88411/2 "2024-04-05T12:14:38Z")

</div>

No, the memory tag would have to hold a json-encoded string, and your binding to `.states` would have to decode the JSON back to an object.

---

<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:** [April 5, 2024, 2:12pm UTC](https://forum.inductiveautomation.com/t/build-memory-tag-to-populate-a-complex-prop-in-perspective-states-in-multistate-button/88411/3 "2024-04-05T14:12:24Z")

</div>

If you use a "Document" data type for the tag, it should "just work" in both directions.
