# Acces Observable data Array in Object

**URL:** <https://forums.fusetools.com/t/acces-observable-data-array-in-object/5865>\
**Category:** How-to Discussions\
**Created:** [July 9, 2016, 4:33pm UTC](https://forums.fusetools.com/t/acces-observable-data-array-in-object/5865 "2016-07-09T16:33:10Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_Heti](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Martin\_Heti](https://forums.fusetools.com/u/Martin_Heti)\
**Post date:** [July 9, 2016, 4:33pm UTC](https://forums.fusetools.com/t/acces-observable-data-array-in-object/5865/1 "2016-07-09T16:33:10Z")

</div>

Hey, i find impossible to acces data from my MainView.ux

```auto
var questionData = Observable({
  flag: "SK_128.png",
  buttons: ["Slovakia", "Czechia"]
});

console.log(questionData.value.buttons[0]) //Print Slovakia

```

In UX i get nothing

```auto
<Text Value="{questionData.buttons[0]}" TextColor="#fff" Alignment="Center" Padding="10,0,10,0" />

```

---

<div class="post-metadata">

**Author:** ![asaxionis](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@asaxionis](https://forums.fusetools.com/u/asaxionis)\
**Post date:** [July 9, 2016, 7:06pm UTC](https://forums.fusetools.com/t/acces-observable-data-array-in-object/5865/2 "2016-07-09T19:06:09Z")

</div>

a simple solution would be to create a seperate function to gain the value and then place that function in the UI

---

<div class="post-metadata">

**Author:** ![Martin\_Heti](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Martin\_Heti](https://forums.fusetools.com/u/Martin_Heti)\
**Post date:** [July 10, 2016, 4:14pm UTC](https://forums.fusetools.com/t/acces-observable-data-array-in-object/5865/3 "2016-07-10T16:14:29Z")

</div>

Thank you for your answer, but i find it very uneffective, for example i have 4 items in buttons array and 4 text elements each with different item from array. Does that mean i have to use 4 functions for each element? Why does this not work naturally?

---

<div class="post-metadata">

**Author:** ![asaxionis](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@asaxionis](https://forums.fusetools.com/u/asaxionis)\
**Post date:** [July 10, 2016, 4:43pm UTC](https://forums.fusetools.com/t/acces-observable-data-array-in-object/5865/4 "2016-07-10T16:43:04Z")

</div>

No you can use the each in the UI

So in the ui you would do

```auto

<Each Items="{yourObject.arrayName}">
    <Text Value="{}" />
</Each>

```

Should help you get started

---

<div class="post-metadata">

**Author:** ![Martin\_Heti](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Martin\_Heti](https://forums.fusetools.com/u/Martin_Heti)\
**Post date:** [July 10, 2016, 5:09pm UTC](https://forums.fusetools.com/t/acces-observable-data-array-in-object/5865/5 "2016-07-10T17:09:43Z")

</div>

Yes, I would like to do this, but what about when each text element have different padding.

---

<div class="post-metadata">

**Author:** ![asaxionis](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@asaxionis](https://forums.fusetools.com/u/asaxionis)\
**Post date:** [July 10, 2016, 5:25pm UTC](https://forums.fusetools.com/t/acces-observable-data-array-in-object/5865/6 "2016-07-10T17:25:03Z")

</div>

you should probably be using objects rather than arrays it’ll be easier to gain the information

---

<div class="post-metadata">

**Author:** ![Martin\_Heti](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Martin\_Heti](https://forums.fusetools.com/u/Martin_Heti)\
**Post date:** [July 10, 2016, 6:00pm UTC](https://forums.fusetools.com/t/acces-observable-data-array-in-object/5865/7 "2016-07-10T18:00:10Z")

</div>

But it will be pain to store information, because i randomly get the country name from JSON and store it to the array via loop. Nevermind then. I have some ideas how to get around this (hovever would not like to do that because it is just more variables to the code), just wanted to know if Im doing something wrong with databinding, why it is not working. Thank you anyways.

---

<div class="post-metadata">

**Author:** ![hello](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/hello/32/162_2.png) [@hello](https://forums.fusetools.com/u/hello)\
**Post date:** [October 26, 2016, 11:45am UTC](https://forums.fusetools.com/t/acces-observable-data-array-in-object/5865/8 "2016-10-26T11:45:40Z")

</div>

Ditto problem here. Have created an object from an API response, but I cannot access Array items:  
Part of the JSON object:

```auto
"images": [
        {
          "type": "IMAGE",
          "key": "XS",
          "url": "http://s.s-bol.com/imgbase0/imagebase3/mini/FC/6/9/6/9/9200000061769696.jpg"
        },
        {
          "type": "IMAGE",
          "key": "S",
          "url": "http://s.s-bol.com/imgbase0/imagebase3/tout/FC/6/9/6/9/9200000061769696.jpg"
        },
        {
          "type": "IMAGE",
          "key": "M",
          "url": "http://s.s-bol.com/imgbase0/imagebase3/thumb/FC/6/9/6/9/9200000061769696.jpg"
        },
        {
          "type": "IMAGE",
          "key": "L",
          "url": "http://s.s-bol.com/imgbase0/imagebase3/regular/FC/6/9/6/9/9200000061769696.jpg"
        },
        {
          "type": "IMAGE",
          "key": "XL",
          "url": "http://s.s-bol.com/imgbase0/imagebase3/large/FC/6/9/6/9/9200000061769696.jpg"
        },
        {
          "type": "IMAGE",
          "key": "XXL",
          "url": "http://s.s-bol.com/imgbase0/imagebase3/extralarge/FC/6/9/6/9/9200000061769696.jpg"
        }
      ]

```

I want to grab **images[2].url** but it does not seem to be working in a my **Each** class:

```auto
<Each Items="{searchItems}">
	<DockPanel Margin="0,0,0,10">
		<Image Url="{images[2].url}" Dock="Left" />
		<Text Value="{title}" Margin="10" />
		<Text Value="{shortDescription}" Margin="10" />
	</DockPanel>
</Each>

```

The **title** and **shortDescription** work fine.

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [October 26, 2016, 12:08pm UTC](https://forums.fusetools.com/t/acces-observable-data-array-in-object/5865/9 "2016-10-26T12:08:06Z")

</div>

Hi!

Array subscripts `[2]` in data bindings are currently not supported in UX markup (as of 0.28.1). Support for this is planned but not yet implemented.

For now you have to restructure your data in JS to make it work. Apologies for the inconvenience, will bump the priority on this issue.

---

<div class="post-metadata">

**Author:** ![omolewastephen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/omolewastephen/32/289_2.png) [@omolewastephen](https://forums.fusetools.com/u/omolewastephen)\
**Post date:** [July 26, 2017, 4:13am UTC](https://forums.fusetools.com/t/acces-observable-data-array-in-object/5865/10 "2017-07-26T04:13:49Z")

</div>

If this was actually sent from a page using router

```
 router.push('somepage', {data: images});

```

How can one unwrap the `this.Parameter` in the ‘somepage’ to access the data node in the observable.
