Update a field based on indexing

Certified Associate Developer

I have two variables of list type, 

local!selecteddata: { id:1, name:test1, id:4,name:test4}.  

local!data:{id:1,name:test1,

                 id:2,name:test2,

                 id2,name:test3,

                 id4,name:test4

}

if I update the "name" fields of local!selecteddata,How do I index local!data and update the field "name" for ids : 1 and 4 . Any help is appreciated 

  Discussion posts and replies are publicly visible