# Create Array of Different Objects for UI-Table

**URL:** <https://discourse.nodered.org/t/create-array-of-different-objects-for-ui-table/66583>\
**Category:** Share Your Projects\
**Created:** [18 August 2022 04:27 UTC](https://discourse.nodered.org/t/create-array-of-different-objects-for-ui-table/66583 "2022-08-18T04:27:44Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Kimo](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@Kimo](https://discourse.nodered.org/u/Kimo)\
**Post date:** [9 October 2022 06:44 UTC](https://discourse.nodered.org/t/create-array-of-different-objects-for-ui-table/66583/4 "2022-10-09T06:44:49Z")

</div>

I managed to solve this issue long time ago. So, maybe someone is looking around on same issue, the answer is to use push method. The steps are to push the variable arr which capture all the required property of message into an array

```auto
let array = flow.get('array');
if(array === undefined){
    array = [];
}
//create object arr
var arr =  
    {
    "No":msg.payload.Name[0].Name,
   .....
   .....
    };
msg.payload = arr;

array.push(msg.payload);
flow.set('array', array);
return msg;

```

Then, next step can refer to this link below

> [@Send payload of array to UI-Template Table](https://discourse.nodered.org/t/send-payload-of-array-to-ui-template-table/66536/12):
>
> the ui-template flow now transfered to ui-table flow: [ { "id": "fd3a93decc2a1270", "type": "tab", "label": "e.g. ui-table", "disabled": false, "info": "" }, { "id": "ec34c6ada52855bd", "type": "change", "z": "fd3a93decc2a1270", "name": "Table Configuration", "rules": [ { "t": "set", "p": "ui\_control", "pt": "msg", "to": "$format…

---

_[View the full topic](https://discourse.nodered.org/t/create-array-of-different-objects-for-ui-table/66583)._
