# Wordpress Json each not working

**URL:** <https://forums.fusetools.com/t/wordpress-json-each-not-working/2637>\
**Category:** How-to Discussions\
**Created:** [June 10, 2016, 4:58pm UTC](https://forums.fusetools.com/t/wordpress-json-each-not-working/2637 "2016-06-10T16:58:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anishtr4](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@anishtr4](https://forums.fusetools.com/u/anishtr4)\
**Post date:** [June 10, 2016, 4:58pm UTC](https://forums.fusetools.com/t/wordpress-json-each-not-working/2637/1 "2016-06-10T16:58:04Z")

</div>

Not getting value in ux while uisng below code.

````auto
       var Observable = require("FuseJS/Observable");

       var data = Observable();

        fetch('http://dev.julienrenaux.fr/wp-json/wp/v2/posts')
        .then(function(response) { return response.json(); })
        .then(function(responseObject) { data.value = responseObject;});

        module.exports = {
            data: data,

        };

        ux//
        <Each Items="{data}">
                    <NewsItem />
                </Each>
                ```

````

but when i change responseObject to

```auto
                .then(function(responseObject) { data.value = responseObject[0];});

```

iam getting the first object and its items and values.

---

<div class="post-metadata">

**Author:** ![ramkrishnaramkiran](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@ramkrishnaramkiran](https://forums.fusetools.com/u/ramkrishnaramkiran)\
**Post date:** [June 11, 2016, 8:41pm UTC](https://forums.fusetools.com/t/wordpress-json-each-not-working/2637/2 "2016-06-11T20:41:57Z")

</div>

1. I am also facing the same problem here… getting a first value only and also …

2. I am wondering how to render a html tags/attributes inside fuse…

For example: wp-restapi having a value like

![file](https://s3.us-east-2.amazonaws.com/fuse-legacy-forum-assets/cEjfaRyu3nwR-legacy-files-U9mtlMfY2ljaYvgH-RBs6kQd75K15iE8vuFZdIlTT.jpg)

how do i show the rendered paragrapgh content inside fuse. (Getting content along with “p” tag)

---

<div class="post-metadata">

**Author:** ![Anders\_Schau\_Knatten](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_schau_knatten/32/41_2.png) [@Anders\_Schau\_Knatten](https://forums.fusetools.com/u/Anders_Schau_Knatten)\
**Post date:** [June 13, 2016, 8:20am UTC](https://forums.fusetools.com/t/wordpress-json-each-not-working/2637/3 "2016-06-13T08:20:59Z")

</div>

[anishtr4@gmail.com](mailto:anishtr4@gmail.com): When you assign directly to `data.value`, your observable gets one item, and that item is the list of posts. What you want to do is make sure the observable itself has the list of posts:

```auto
         .then(function(responseObject) {
             responseObject.forEach(function(item){
                 data.add(item);
             })
         });

```

Full example:

```auto
<App>
    <JavaScript>
        var Observable = require("FuseJS/Observable");

        var data = Observable();

         fetch('http://dev.julienrenaux.fr/wp-json/wp/v2/posts&#39;)
         .then(function(response) { return response.json(); })
         .then(function(responseObject) {
             responseObject.forEach(function(item){
                 data.add(item);
             })
         });

         module.exports = {
             data: data,

         };
    </JavaScript>
    <StackPanel>
        <Each Items="{data}">
            <Text Value="{id}"/>
        </Each>
    </StackPanel>
</App>

```

---

<div class="post-metadata">

**Author:** ![Anders\_Schau\_Knatten](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_schau_knatten/32/41_2.png) [@Anders\_Schau\_Knatten](https://forums.fusetools.com/u/Anders_Schau_Knatten)\
**Post date:** [June 13, 2016, 8:23am UTC](https://forums.fusetools.com/t/wordpress-json-each-not-working/2637/4 "2016-06-13T08:23:18Z")

</div>

[ramkrishnaramkiran@gmail.com](mailto:ramkrishnaramkiran@gmail.com) : Fuse currently doesn’t have a good solution for rich text. We’re working on it, but I can’t promise you a specific release date.

In the mean time, you might be better off displaying the posts in a `WebView`.

---

<div class="post-metadata">

**Author:** ![James\_Arthur](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/james_arthur/32/228_2.png) [@James\_Arthur](https://forums.fusetools.com/u/James_Arthur)\
**Post date:** [November 10, 2016, 6:51am UTC](https://forums.fusetools.com/t/wordpress-json-each-not-working/2637/5 "2016-11-10T06:51:38Z")

</div>

I have a same problem.

---

<div class="post-metadata">

**Author:** ![Kristian\_Hasselknipp](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/kristian_hasselknipp/32/549_2.png) [@Kristian\_Hasselknipp](https://forums.fusetools.com/u/Kristian_Hasselknipp)\
**Post date:** [November 10, 2016, 7:12am UTC](https://forums.fusetools.com/t/wordpress-json-each-not-working/2637/6 "2016-11-10T07:12:19Z")

</div>

James Arthur:

When your request returns an array of data, you have to fill the Observable with each item from the array. Anders’ solution above works, but the quickest way is to use `yourObservable.replaceAll(responseData)`
