# Cannot get all IDs for custom export smart action

**URL:** <https://community.forestadmin.com/t/cannot-get-all-ids-for-custom-export-smart-action/2691>\
**Category:** Help me!\
**Tags:** howtos\
**Created:** [June 14, 2021, 3:00am UTC](https://community.forestadmin.com/t/cannot-get-all-ids-for-custom-export-smart-action/2691 "2021-06-14T03:00:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NathanLe](https://avatars.discourse-cdn.com/v4/letter/n/dc4da7/32.png) [@NathanLe](https://community.forestadmin.com/u/NathanLe)\
**Post date:** [June 14, 2021, 3:00am UTC](https://community.forestadmin.com/t/cannot-get-all-ids-for-custom-export-smart-action/2691/1 "2021-06-14T03:00:03Z")

</div>

## Expected behavior

I have 2023 records. When I click on “SELECT ALL RECORDS” then click on Actions → My smart export, I should get 2023 records ID in `req.body.data.attributes.ids`.

## Actual behavior

There are only 15 records ID of the first page in `req.body.data.attributes.ids` array.

## Context

Please provide any relevant information about your setup.

- Package Version:
- Express Version: 4.17.1
- forest-express-mongoose: 7.0.0
- json2csv: “^5.0.6”
- Project Name: Orthotekos

---

<div class="post-metadata">

**Author:** ![Arnaud\_Moncel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaud_moncel/32/24_2.png) [@Arnaud\_Moncel](https://community.forestadmin.com/u/Arnaud_Moncel)\
**Post date:** [June 14, 2021, 8:52am UTC](https://community.forestadmin.com/t/cannot-get-all-ids-for-custom-export-smart-action/2691/2 "2021-06-14T08:52:54Z")

</div>

Hi @NathanLe 👋 welcome to our community.  
If you use the `select all` feature, you need to use `getIdsFromRequest` helper from `RecordsGetter` like the code below:

```javascript
const ( RecordGetter, permissionMiddlewareCreator } = require('forest-express-mongoose');
const { companies } = require('../models');

router.get('/companies.csv', permissionMiddlewareCreator.export(), (request, response, next) => {
  new RecordsGetter(companies).getIdsFromRequest(request)
    .then((ids) => {
      // Do what you want.
    });
});

```

Let me know if that help.

---

<div class="post-metadata">

**Author:** ![NathanLe](https://avatars.discourse-cdn.com/v4/letter/n/dc4da7/32.png) [@NathanLe](https://community.forestadmin.com/u/NathanLe)\
**Post date:** [June 14, 2021, 10:08am UTC](https://community.forestadmin.com/t/cannot-get-all-ids-for-custom-export-smart-action/2691/3 "2021-06-14T10:08:49Z")

</div>

> [@Arnaud\_Moncel](#):
>
> `new RecordsGetter(companies).getIdsFromRequest(request)`

I had a full id list of selected records. Thanks Arnaud Moncel!
