# Using "populate" in addon

**URL:** <https://discourse.getcockpit.com/t/using-populate-in-addon/3042>\
**Category:** Addons\
**Created:** [August 22, 2024, 8:01pm UTC](https://discourse.getcockpit.com/t/using-populate-in-addon/3042 "2024-08-22T20:01:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![CristianDev](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/cristiandev/32/1402_2.png) [@CristianDev](https://discourse.getcockpit.com/u/CristianDev)\
**Post date:** [August 22, 2024, 8:02pm UTC](https://discourse.getcockpit.com/t/using-populate-in-addon/3042/1 "2024-08-22T20:02:00Z")

</div>

I want to use the populate attribute to fetch all the nested collections that my “Payments” collection has, but I’ve tried adding it like this: `populate => 1`, but it doesn’t work for me.  
This is how I get the data, but I need to add the populate attribute:

```auto
$data= $app->module('content')->items('payments', [
'sort' => ['_created' => 1],
'limit' => 1,
]);

```

_I am using the latest version of Cockpit available_
