# Smart action is not applied to all selected items in the collection

**URL:** <https://community.forestadmin.com/t/smart-action-is-not-applied-to-all-selected-items-in-the-collection/1727>\
**Category:** Help me!\
**Created:** [January 29, 2021, 3:38pm UTC](https://community.forestadmin.com/t/smart-action-is-not-applied-to-all-selected-items-in-the-collection/1727 "2021-01-29T15:38:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vasilii](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/vasilii/32/976_2.png) [@Vasilii](https://community.forestadmin.com/u/Vasilii)\
**Post date:** [January 29, 2021, 3:38pm UTC](https://community.forestadmin.com/t/smart-action-is-not-applied-to-all-selected-items-in-the-collection/1727/1 "2021-01-29T15:38:22Z")

</div>

After applying filters on collection, I’m selecting records on all the pages.  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/0/0a5b7081412d4f46f20a76a060d53503b7a39332.png)

As the message and filters’ count state, there are 37 records.  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/3/3f86df897db656bc30bf12fa84a26300bc083bfa.png)

But after smart action is applied, only 15 items are updated.  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/d/d4ecf3d0694649fd55029af48b8220a8e43f4b85.png)

`ids` for update are retrieved from the request body in the following manner:

```javascript
const attributes = request.body.data.attributes;
jobParams.ids = attributes.ids;

```

## Expected behavior

All selected 37 ids (from all the pages) are sent to the back-end.

## Actual behavior

Only ids selected on the current page are sent.

---

<div class="post-metadata">

**Author:** ![anon16419211](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@anon16419211](https://community.forestadmin.com/u/anon16419211)\
**Post date:** [January 29, 2021, 3:57pm UTC](https://community.forestadmin.com/t/smart-action-is-not-applied-to-all-selected-items-in-the-collection/1727/2 "2021-01-29T15:57:01Z")

</div>

Hello @Vasilii,

To get around this problem you can edit the number of records per page by clicking on the brush at the top right of your screen and [increasing the number of records visible per page](https://docs.forestadmin.com/documentation/v/v4/reference-guide/views/using-the-layout-editor-mode/customizing-the-table-view).

I will take a look at it on my side.

Tell me if it helps! 🙂

---

<div class="post-metadata">

**Author:** ![anon79585656](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@anon79585656](https://community.forestadmin.com/u/anon79585656)\
**Post date:** [February 1, 2021, 11:16am UTC](https://community.forestadmin.com/t/smart-action-is-not-applied-to-all-selected-items-in-the-collection/1727/3 "2021-02-01T11:16:38Z")

</div>

Hello @Vasilii,

Thank you for your patience.

To properly use the “select all” feature, you might need to update your code.  
Please see here how to:  
[https://docs.forestadmin.com/documentation/how-tos/maintain/upgrade-notes-sql-mongodb/upgrade-to-v6#select-all-feature](https://docs.forestadmin.com/documentation/how-tos/maintain/upgrade-notes-sql-mongodb/upgrade-to-v6#select-all-feature)

The `RecordsGetter` helper should come in handy.

---

<div class="post-metadata">

**Author:** ![Vasilii](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/vasilii/32/976_2.png) [@Vasilii](https://community.forestadmin.com/u/Vasilii)\
**Post date:** [February 1, 2021, 11:18am UTC](https://community.forestadmin.com/t/smart-action-is-not-applied-to-all-selected-items-in-the-collection/1727/4 "2021-02-01T11:18:42Z")

</div>

Hi, @anon79585656! Thanks for the response, I’ll try it out & get back to you on that one.

---

<div class="post-metadata">

**Author:** ![Vasilii](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/vasilii/32/976_2.png) [@Vasilii](https://community.forestadmin.com/u/Vasilii)\
**Post date:** [February 1, 2021, 3:30pm UTC](https://community.forestadmin.com/t/smart-action-is-not-applied-to-all-selected-items-in-the-collection/1727/5 "2021-02-01T15:30:40Z")

</div>

@anon79585656, thanks a lot, it does work as expected 👏🏼
