Smart Action On All Filtered Records

Hey Forest,

We are trying to build a smart action that will involve up to a few thousand records at once. Basically we want the ability to filter a table using the default Forest filters and then run this global action and once we do, somehow have a list of all of the ids of the filtered records available similar to I feel as though this should be possible as Forest provides similar behavior in the default export route as it exports all currently filtered records.

How can we achieve this behavior in the context of a smart action?
Thank you!

Hi @Arda_Yurdakul :wave: !

I’m sorry but I did not understood your usecase :sweat_smile:.
You want to filter a table view ? Or to trigger an action that will apply only on some records ?

Hi @vince !

Here is the flow we want to achieve in one specific table we have:

  1. We have a table of Users
  2. We apply some filters on it and are left with around 2-3 thousand records
  3. We execute a global action
  4. Within the context of the post route of the action we have a list of all the ids of the currently filtered records mentioned above
  5. We use said list to execute some logic

Okey so it just looks like you should do a bulk action.
If you do:

const recordsGetter = new RecordsGetter(companies, request.user, request.query);
return recordsGetter.getIdsFromRequest(req)
  .then(ids => { ... });

I have just now noticed that you can select all records, we thought you could only select the current page and did not see the tiny arrow mext to the checkbox. The UI for this is due for an update I would say :laughing:

Thank you for the help!