# Pass request as param to getIdsFromRequest not working

**URL:** <https://community.forestadmin.com/t/pass-request-as-param-to-getidsfromrequest-not-working/1295>\
**Category:** Help me!\
**Created:** [November 13, 2020, 3:07pm UTC](https://community.forestadmin.com/t/pass-request-as-param-to-getidsfromrequest-not-working/1295 "2020-11-13T15:07:49Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bojan\_Antonijevic](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/bojan_antonijevic/32/205_2.png) [@Bojan\_Antonijevic](https://community.forestadmin.com/u/Bojan_Antonijevic)\
**Post date:** [November 13, 2020, 3:07pm UTC](https://community.forestadmin.com/t/pass-request-as-param-to-getidsfromrequest-not-working/1295/1 "2020-11-13T15:07:49Z")

</div>

Hi team,

I take an example from here:

> **[Default routes](https://docs.forestadmin.com/documentation/reference-guide/routes/default-routes#delete-a-list-of-records)**

```javascript
return new RecordsGetter(accounts).getIdsFromRequest(request)
        .then((ids) => {
            console.log(ids);
        })
        .catch(next);

```

And I could see this issue in the editor and on terminal:

 ![Screenshot 2020-11-13 at 14.11.25](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/4/4770c50496b0edab00a9c19ca5ca2a07405b5dc7.png)

What is the easiest way to use getIdsFromRequest or similar?

---

<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:** [November 13, 2020, 3:40pm UTC](https://community.forestadmin.com/t/pass-request-as-param-to-getidsfromrequest-not-working/1295/3 "2020-11-13T15:40:34Z")

</div>

Hi 👋 @Bojan_Antonijevic, thank you for your feedback.  
It seem to have bad type definition on our end.  
Can you put this instruction `// tslint:disable-next-line` before the call of the function please 🙏.  
We apologize for this inconvenient.  
I transferred the problem to our development team.  
I will you keep update when the issue was solved.  
Thank you.

---

<div class="post-metadata">

**Author:** ![Bojan\_Antonijevic](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/bojan_antonijevic/32/205_2.png) [@Bojan\_Antonijevic](https://community.forestadmin.com/u/Bojan_Antonijevic)\
**Post date:** [November 13, 2020, 4:08pm UTC](https://community.forestadmin.com/t/pass-request-as-param-to-getidsfromrequest-not-working/1295/4 "2020-11-13T16:08:23Z")

</div>

Hey @Arnaud_Moncel, thank you for your reply.

// tslint:disable-next-line - this one is not working but I could ignore the warning with  
// @ts-ignore

And after that, we have the next issue in the terminal

 ![Screenshot 2020-11-13 at 17.05.09](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/9/90c8f7f7c74eba571ca3a1042f0cf1881f308ade.png)

Could you consult with the dev team and check is it actually possible to get ids from the request?

---

<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:** [November 13, 2020, 4:32pm UTC](https://community.forestadmin.com/t/pass-request-as-param-to-getidsfromrequest-not-working/1295/5 "2020-11-13T16:32:30Z")

</div>

Which routes did you try to override ?  
I try on my end and it’s work properly for the `Delete a list of records` route.

---

<div class="post-metadata">

**Author:** ![Bojan\_Antonijevic](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/bojan_antonijevic/32/205_2.png) [@Bojan\_Antonijevic](https://community.forestadmin.com/u/Bojan_Antonijevic)\
**Post date:** [November 13, 2020, 5:48pm UTC](https://community.forestadmin.com/t/pass-request-as-param-to-getidsfromrequest-not-working/1295/6 "2020-11-13T17:48:44Z")

</div>

I am trying to Get a list of records route.

Is this means it’s possible only for Deleting?

---

<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:** [November 16, 2020, 9:40am UTC](https://community.forestadmin.com/t/pass-request-as-param-to-getidsfromrequest-not-working/1295/7 "2020-11-16T09:40:48Z")

</div>

Yes unfortunately, it’s only available for `Delete a list of records` route.

---

<div class="post-metadata">

**Author:** ![Bojan\_Antonijevic](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/bojan_antonijevic/32/205_2.png) [@Bojan\_Antonijevic](https://community.forestadmin.com/u/Bojan_Antonijevic)\
**Post date:** [November 16, 2020, 9:42am UTC](https://community.forestadmin.com/t/pass-request-as-param-to-getidsfromrequest-not-working/1295/8 "2020-11-16T09:42:30Z")

</div>

Thanks for the information

---

<div class="post-metadata">

**Author:** ![anon62739609](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@anon62739609](https://community.forestadmin.com/u/anon62739609)\
**Post date:** [November 16, 2020, 10:36am UTC](https://community.forestadmin.com/t/pass-request-as-param-to-getidsfromrequest-not-working/1295/9 "2020-11-16T10:36:20Z")

</div>

Why are you trying to use this function 🤔 ?

---

<div class="post-metadata">

**Author:** ![Bojan\_Antonijevic](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/bojan_antonijevic/32/205_2.png) [@Bojan\_Antonijevic](https://community.forestadmin.com/u/Bojan_Antonijevic)\
**Post date:** [November 16, 2020, 7:46pm UTC](https://community.forestadmin.com/t/pass-request-as-param-to-getidsfromrequest-not-working/1295/10 "2020-11-16T19:46:52Z")

</div>

We need a list of ids to send on our API endpoint to reformat some fields.  
A workflow should be:

1. Get ids
2. Send it via superagent on the endpoint and get proper responses for some fields.
3. Replace field values on forest admin records and send them as a response.

We manage it like this:

```javascript
const recordsGetter = new RecordsGetter(accounts);
const accounts = recordsGetter.getAll(request.query);
let ids = [];
for (let i = accounts.length - 1; i >= 0; i--) {
     ids.push(accounts[i].dataValues.id)
}

```

But when we see getIdsFromRequest we were wondering could we replace it with only one line.

---

<div class="post-metadata">

**Author:** ![anon36130554](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@anon36130554](https://community.forestadmin.com/u/anon36130554)\
**Post date:** [November 17, 2020, 9:20am UTC](https://community.forestadmin.com/t/pass-request-as-param-to-getidsfromrequest-not-working/1295/11 "2020-11-17T09:20:10Z")

</div>

> [@Bojan\_Antonijevic](#):
>
> Hey @Arnaud_Moncel, thank you for your reply.
> 
> // tslint:disable-next-line - this one is not working but I could ignore the warning with  
> // @ts-ignore

Hello @Bojan_Antonijevic 👋

Just a side note on this, a new version of the types have been released 🎉

You can install the latest version of the package @types/forest-express-sequelize to @latest and remove the typescript deactivation.

Tell me if it fixes the issue 🙌

Do you still encounter the issue you explained at the end of the thread ?

Juste a little note on the `getIdsFromRequest`, it is only usable on the `/delete` route (to support mass deletion) and the smart-action routes. It will not work on other routes.

Thanks for your feedback 😄 on types, don’t hesitate if you encounter any other issue.

Steve.
