# Update Observables value in an Observable

**URL:** <https://forums.fusetools.com/t/update-observables-value-in-an-observable/4362>\
**Category:** Bug Reports\
**Created:** [March 14, 2017, 1:31pm UTC](https://forums.fusetools.com/t/update-observables-value-in-an-observable/4362 "2017-03-14T13:31:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mehdi.jarraya](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@Mehdi.jarraya](https://forums.fusetools.com/u/Mehdi.jarraya)\
**Post date:** [March 14, 2017, 1:31pm UTC](https://forums.fusetools.com/t/update-observables-value-in-an-observable/4362/1 "2017-03-14T13:31:10Z")

</div>

Hi guys,  
I have a js file that contain my application global var such as the user Observable which contains Observables name,email, profilePicture…  
I have defined it like the syntax in the Docs  
(globalVar.js file)

```auto
    var Observable = require("FuseJS/Observable");
    var user = Observable(
        { name: Observable() },
        { email: Observable() },
        { lastname: Observable() },
        { country: Observable() },
        { city: Observable() },
        { phoneNumber: Observable() },
        { profilePicture: Observable() }
        );
module.exports = {
	user:user
};

```

but when i try to update user properties in other pages it doesn’t work  
(login.js file)

```auto
var globalVar=require('js/globalVar');
globalVar.user.value.name.value=json.patient.name;
globalVar.user.value.email.value=json.patient.email;
globalVar.user.value.city.value=json.patient.city;
globalVar.user.value.country.value=json.patient.country;

```

when i have changed the declaration Syntax the update works perfectly 🙂  
(globalVar.js file)

```auto
var user=Observable(
	     {email:Observable() ,
         name: Observable() ,
        lastname: Observable(),
        city:Observable(),
        country:Observable(),
        phoneNumber:Observable(),
        profilePicture:Observable()
        });

```

---

<div class="post-metadata">

**Author:** ![Remi\_Pedersen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/remi_pedersen/32/432_2.png) [@Remi\_Pedersen](https://forums.fusetools.com/u/Remi_Pedersen)\
**Post date:** [March 14, 2017, 1:44pm UTC](https://forums.fusetools.com/t/update-observables-value-in-an-observable/4362/2 "2017-03-14T13:44:37Z")

</div>

In which docs did you find the first syntax? It is definitely not correct. 🙂

---

<div class="post-metadata">

**Author:** ![Mehdi.jarraya](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@Mehdi.jarraya](https://forums.fusetools.com/u/Mehdi.jarraya)\
**Post date:** [March 14, 2017, 1:51pm UTC](https://forums.fusetools.com/t/update-observables-value-in-an-observable/4362/3 "2017-03-14T13:51:38Z")

</div>

[https://www.fusetools.com/docs/fuse/reactive/databinding\_1](https://www.fusetools.com/docs/fuse/reactive/databinding_1)

```auto
<JavaScript>
    var Observable = require("FuseJS/Observable");
    var data = Observable(
        { name: Observable("Hubert") },
        { name: Observable("Marjory") });
    module.exports = {
        data: data
    };
</JavaScript>

```

---

<div class="post-metadata">

**Author:** ![Remi\_Pedersen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/remi_pedersen/32/432_2.png) [@Remi\_Pedersen](https://forums.fusetools.com/u/Remi_Pedersen)\
**Post date:** [March 14, 2017, 2:37pm UTC](https://forums.fusetools.com/t/update-observables-value-in-an-observable/4362/4 "2017-03-14T14:37:51Z")

</div>

That code is for an entirely different use case, where you want to have a list of objects with the same type (for instance to iterate over them in an `Each`).

In the first case (your first post) you need _one_ object with different properties, that’s why the 2nd way of declaring it is correct.
