Is it possible to select all results, even if all results are not shown in the repeat?

Hey all,

So we have a couple of repeats that have 15 or 25 results per page. We have a checkbox setup where you can select all by checking the top checkbox.

If the user actually has 200 results that are returned, but limited to 25 with pagination - is it possible to select all 200 results somehow ?

1 Like

Selection all could be a flag for server action.

You could store the list of all ids in session or db in the server action where api is called.
Then send a flag to the other server action which would execute the command on selected items that its a select all operation.

1 Like

Thanks for the reply @sid.

The data comes from an API, that is paginated, so we never return the whole list of ids unfortunately - otherwise the above would be a perfect option. I don’t see any way other than another API call to get more IDs?

The question is misleading in that case.
It seems you have no control over the data being paginated or not.

So yes repeating calls is the way. Although its not a good solution, but what you can do is call API, and from result you can identify how many pages are there and then run a repeat step to call the same API multiple times.

Thanks Sid. I can see how that reads in a misleading way.

We are calling an API, 100’s of millions of records. We have full control over pagination, but only want to display a set number of records per page for obvious reasons - currently trying to handle this with a single additional api call.

Well if you have control over pagination, when you want to perform an operation on ALL results, you just need to retrieve complete data based on the flag sent from client side.
Not sure if the communication is clear here… but if the additional API call is working for you, then you should just use that.
Client side cannot in any way “select all” when it does not have the data. It can only be done on server side.

If you are performing an operation on all results, could you not set a checkbox field named ‘selectall’?
It would make unticking individuals difficult unless you had an ‘exclude’ array holding ids that had been deselcted.
When the form is processed, if selectall is set, the Server Action processing the form/data reads it and performs the database/API action on all (minus exclusions)?