# When I populate a list in uiDesigner 1 value updates all values (EDITED)

**URL:** <https://community.ofelia.com/t/when-i-populate-a-list-in-uidesigner-1-value-updates-all-values-edited/24063>\
**Category:** Q&A\
**Tags:** ui-designer\
**Created:** [29 January 2024 12:16 UTC](https://community.ofelia.com/t/when-i-populate-a-list-in-uidesigner-1-value-updates-all-values-edited/24063 "2024-01-29T12:16:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogoca](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@rogoca](https://community.ofelia.com/u/rogoca)\
**Post date:** [29 January 2024 12:16 UTC](https://community.ofelia.com/t/when-i-populate-a-list-in-uidesigner-1-value-updates-all-values-edited/24063/1 "2024-01-29T12:16:46Z")

</div>

Hello,  
  
I'm trying to populate a list of users with their roles, this is the code:

&nbsp;

$data.user = 0;

$data.listaTratada=[];

$data.grupo = "";

for( var i = 0; $data.listaUsuariosTotal.length \>= i; i++){

&nbsp; &nbsp; $data.apiGetRoles = "../API/identity/membership?p=0&c=10&f=user\_id="+$data.listaUsuariosTotal[i].id+"&d=role\_id";

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$data.listaTratada.unshift({"grupo":$data.RolesPorUsuario[0].role\_id.name,  
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"usuario":$data.listaUsuariosTotal[i].firstname,  
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"id":$data.listaUsuariosTotal[i].id});  
  
$data.listaTratada=[];  
  
}

&nbsp;

when launching this code, "grupo" changes to the same value on every element on the table, "grupo" is obtained from an api call, saved on the "RolesPorUsuario" variable, is there a reason why it does this and if there a fix?

&nbsp;

&nbsp;

EDIT : turns out the api call where I get "grupo" doesn't update fast enough, is there any way to guarantee the api call has been made properly?

---

<div class="post-metadata">

**Author:** ![mikuri](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/mikuri/32/1190_2.png) [@mikuri](https://community.ofelia.com/u/mikuri)\
**Post date:** [31 January 2024 10:22 UTC](https://community.ofelia.com/t/when-i-populate-a-list-in-uidesigner-1-value-updates-all-values-edited/24063/2 "2024-01-31T10:22:24Z")

</div>

"grupo" variable takes the value of the last user of listaUsuariosTotal, isn it??

It could be about the order of execution of the task. I suppose that the&nbsp;&nbsp;External APis execute in the end, and change all the values with the last value of listaUsuariosTotal.

---

<div class="post-metadata">

**Author:** ![rogoca](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@rogoca](https://community.ofelia.com/u/rogoca)\
**Post date:** [31 January 2024 15:24 UTC](https://community.ofelia.com/t/when-i-populate-a-list-in-uidesigner-1-value-updates-all-values-edited/24063/3 "2024-01-31T15:24:16Z")

</div>

hello,  
that's correct, how could I make it so the api gets called as I call it? or how can I summon the api whenever I need it
