Hello,
there are many ways to do what you are trying to achieve.
A very important variable though is what kind of database you are using: Local, Online, Airtable, Excel, ecc…
I’d suggest you have a look first of all here How to ask Great Questions v2.0 - Learn About the Thunkable Community - Community.
Also this one may result helpful - Sorting Data viewer list - Questions about Thunkable - Community
Giving the community more information will help to get a quicker and more precise answer for your problem
Hope it helped