# How to manipulate in can.Map data returned from server/fixture?

**URL:** <https://forums.bitovi.com/t/how-to-manipulate-in-can-map-data-returned-from-server-fixture/274>\
**Category:** CanJS\
**Created:** [May 19, 2016, 10:54pm UTC](https://forums.bitovi.com/t/how-to-manipulate-in-can-map-data-returned-from-server-fixture/274 "2016-05-19T22:54:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![doktor\_lubicz](https://avatars.discourse-cdn.com/v4/letter/d/96bed5/32.png) [@doktor\_lubicz](https://forums.bitovi.com/u/doktor_lubicz)\
**Post date:** [May 19, 2016, 10:54pm UTC](https://forums.bitovi.com/t/how-to-manipulate-in-can-map-data-returned-from-server-fixture/274/1 "2016-05-19T22:54:46Z")

</div>

Hi my problem is to understand how to manipulate data received from server in can.Map.  
I receive data from server (use fixture):

`[  
{  
“id”: 111,  
“name”: “Robert”,  
“surname”: “Aa”,  
},  
{  
“id”: 222,  
“name”: “John”,  
“surname”: “Bb”,  
},  
{  
“id”: 333,  
“name”: “Jack”,  
“surname”: “Cc”,  
},

]`

var MV = can.Map.extend({  
define:{  
lists:{  
get: function() {  
return Users.findAll({});  
}  
}  
});

For these I prepare in template individual input and would like to add one link “add”:  
`{{#each lists.value}} <input type="text" name = {{name}}> {{/each}} <a href=.... ?????`  
How this adding process should looks like if I want to add e.g user with id:“111” and want to display on the next template summary of his data? Should, after receiving, put data into List with key equals id?

P.s. I use that way to change templates:  
`{{#switch action}} {{#case 'summary'}} <courier-summary></courier-summary> {{/case}} {{#default}} {{/default}} {{/switch}}`

When can.Component is used, viewModel: contains only one can.Map. I suppose that every code (attributes, functions) should be inside this one can.Map - is that correct? So how values of attributes from one component are passed to the other? Only via templates?

---

<div class="post-metadata">

**Author:** ![pYr0x](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/pyr0x/32/95_2.png) [@pYr0x](https://forums.bitovi.com/u/pYr0x)\
**Post date:** [May 22, 2016, 11:23am UTC](https://forums.bitovi.com/t/how-to-manipulate-in-can-map-data-returned-from-server-fixture/274/2 "2016-05-22T11:23:21Z")

</div>

here is a thread i posted… [How can i predefine a new can.connect instance to a available set](http://forums.bitovi.com/t/how-can-i-predefine-a-new-can-connect-instance-to-a-available-set/235)  
it is about adding a new item to a List  
here is a working example… it is done with can.connect, which is more future proof 😉  
[http://jsbin.com/zomuyelipi/1/edit?html,js,output](http://jsbin.com/zomuyelipi/1/edit?html,js,output)
