Hi folks, I’m looking for some help with making a list.
Here is the use case: I serve up vacation destinations, one at a time. Each time I serve one up, the user will indicate either he is interested or not interested by clicking on a button. Regardless of the button, the app will present the next destination on the list.
Still a beginner but it looks like the only way to display data is to make a list because I don’t get the option of picking a table from an external source otherwise. But when making a list, it’s an infinite scroll and I’m not able to display one destination at a time.
manually fill it in, be sure that ID value is unique (say, 1…20 for 20 destinations)
create the “Current Destination” field in the users’ database, default = 1
filter the list of destination by Destination ID = User’s Current destination
increase +1 / decrease -1 User’s Current destination when clicking buttons (say, left/right)
Don’t forget about “corner cases” (Current destination = 1 and Current destination = 20), for example, you can disable the button.
Also, look carefully for IDs in destinations database - if they are not in order, this may result in glitches.
This logic could be made more “data-driven”, by storing prev and next destinations IDs for each record, and changing Current destination accordingly.
Thanks for getting backing to me so quickly. I’m not sure if this approach will work for me.
I created a destination_id field to make each destination unique.
My table (Airtable) automatically fills this value in so no need to manually do it.
This is where I think things will not work -> different users will have access to different destinations.
After thinking through this, I will have to add a 3rd table to make the association between users and destinations, which is fine. But my question is more around creating the UI aspect of it…
Is there a way to associate UI fields to database values without making a list? When I create a list, I can easily point it to table > field. But creating a list automatically assumes that I want this to scroll one after another when all I really want is to show one destination at a time.
Thanks @Ben. I thought about using the swiper but it’s the exact thing I’m trying to avoid (the “tinder for x”). I think I need to custom build it or reset my expectations.
So if you need to display some other info (title, description, etc etc etc), you can create all the interface elements, create a list from them, set up the fields’ valued from the “Destinations” collection, and then add a filter for this list by Destination ID.
And the logic behind the filter (how you change the current Destination ID for user) could be different.
Thanks i can see your way… it seems complicated for a simple action of next and previous.
Why not to have a property that creates a serial number for every record created…??? LIke the creation date…???
Thanks @Victor. I was able to hack together something that works for now. I don’t think this solution will work as it scales bc of other complexities but for now, I have what I need.