How to link copied items to originals

I am working on an app that suggests outfits to the users.

I have a list of clothing items (33) and a list of outfits (180) I have them stored in bubble where outfits reference their components from the 33 clothing items by their IDs. Clothing items have “availability” (clean, laundry damages etc) and are individual to the user while outfits are public, shared data.

The main problem I am facing is that I want to display outfits to the users but only outfits for which the user has all clothing items available. Without a connection of the user’s clothing items to the outfit components I don’t know how this is possible.

When a new user is created I copy that original list of 33 clothing items and set their owner to the current user. When I want to display the outfits however those are still linked to the original clothing items IDs. Is there any way that I can connect the copied items to their origin?

Any help is greatly appreciated!

Can’t you just search for all outfits with a filter to check if outfit's clothing items are available?

I’m not sure if I understand your issue properly. Could you provide screenshots of your database structure?

The outfits clothing items reference the original ones, not the clothing items owned by the current user

Hi @the_sal_dave :wave:

As I understood, you want your users continue to receive the outfits suggestions but only for the cloth that they can wear. And the combination (outfits) are linked to the original clothing . The issue is, when you copy all the clothes, you lost their unique id and consequently, the link between them and the outfits.

What I suggest is to Add another field in your clothing DataType called (Original ID → text), where you will store the original unique ID of this clothing when it is copied to your users. Doing this, you can access the original unique ID and stille make your connection between them and the outfits.

2 Likes

I just had the idea to assign a serial number to all clothing items from 1-33. The I can sort the users clothing items with that SN and use the “Current users:Clothing item # SN”

I am implementing this right now

Thanks for the help @rpetribu , @ntabs !

2 Likes