Confused - How to create relationship between tables in database

To be explicit (because this also comes up a lot)

Let’s suppose you create a Shopify Variant in Step 1 and Shopify Product in Step 2. In Step 2, you want too add the Shopify Variant you created to the Variants list. In the expression composer, this looks like:

Variants add Result of step 1 (i.e, the thing you created in Step 1).

This is different from:

Variants add Result of step 1's unique ID because unique ID is a string, not an object.

To make matters more confusing, in the Bubble database, when you correctly do Variants add Result of step 1, what actually happens is Bubble adds the unique ID of the Shopify Variant to the List of Variants.

It does sound incredibly conceptually strange - there’s the Thing (a data) and the Thing’s unique ID (which is a property of the Thing). However, when you save a Thing you’re saving the unique ID (which is a property of the Thing). Perhaps you could imagine each thing as having two unique IDs - one is the Thing itself, and the other is the uniqueID property of the Thing. The former is a data type (e.g Shopify Variant), and the latter is a string (text).

The more I think about it the more it gives me a headache but you’ll get your head around it :slight_smile: I know you didn’t ask for this information, the whole Thing vs Unique ID thing (ha) just sent me into a crisis. I’m so sorry.