Swapsy lets users swipe right on other people’s listings until there is a match and they can swap their stuff. I’m having trouble designing how the database is set up to allow this. So far I’ve built a ‘match’ table where when a user swipes right on a listing a row is made to include the user and the listing - the aim is to then update this row when the listing owner then swipes right on a listing of the other person - but I can’t seem to figure out how to have a row searched for and then updated based on an action?
I haven’t seen a ‘search’ action, is there a way to achieve this that I haven’t unearthed?
You would need to dynamically build a single relation to the matching row, and then use a Set Column Values action through that relation.
I’ve not done much with the Swipe layout, but I am aware that it can be fiddly to work with. So I’m not sure how well the above might work.
I like the idea, but I can’t see a relation being able to work through time and through multiple listings owned by multiple people. It’s like adding another level of complexity than Tinder because you can match with someone by liking one of their listings (any listing) and them liking any of yours, so its not a 1 to 1 thing.
are you thinking it’s a dormant ‘match’ that is updated when the second user ‘likes’ a related listing?
Something like that. Can you show me what your table structure looks like so I can better visualise it?
Here’s the users
How I’ve set up the ‘match’ (it doesn’t work yet)
And how the listings look
Once I get the match mechanic to work I’ll layer on other functions (notifications, ‘swapping’ workflow, filtering listings, auto filtering based on activity etc
So which column would you be looking to update in the Match table when a match is made?
Also, that Listing ID in the Match table - where does that come from?
If you could have multiple rows that form a match and you want to update them all, then I think you’ll be in for a challenge. As far as I’m aware, you can only ever update one row at a time with a single action - without turning to something external, such as Apps Script, Integromat, etc.
Anyway… just thinking out aloud a little…
When a lister is viewing the app, you already have a relation to all their listings that have been “liked”. You could use that to create a joined list of all the “liker ID’s”. Then when your lister likes/swipes a listing from another user, you could compare the listers ID of that item to the joined list - if the joined list includes that ID then you have a match. But where you would go from there, I’m not sure. You could use that ID (plus the users ID) to build a single relation to the Match table, but if there are multiple rows then you’ll only get the first row that matches.
Anyway, maybe that gives you some ideas?
That’s some great thinking, thanks Darren. I think you’re right, as I keep playing with dormant relations and ‘if that’ columns I should be able to come up with something. an issue occurs when user A likes multiple listings of user B and vis versa! A problem to grapple with once I’ve overcome this one.