Combine Variables for a product (Shopify like Feature)

HI everyone!

I found just one topic here about it and unfortunately with no solution.

So hopefully anyone out there can help me.

I have an app where the user can add products and also variants to each product.

(Ex. Size, Color, Material…etc)

Every variants can have X values.

(Ex. Large, Small, Medium… Green, Red, Blue… etc)

What i need them is that based on the inputs from the user, create possible combinatios of variables to save in my database.

(Ex. Small Green, Small Blue, Small Red… Medium Green, Medium Red, Medium Blue…etc)

Does anyone have any idea how to do it properly?

Cheers to y’all.

I would save the variants as option sets - i.e. one option set for color, one for size etc.

You could use the workflow “when an input’s value is changed” to then save that combination to a data type (if it didn’t already exist) where you save the options as a list against a particular field.

Josh @ Support Dept
Helping no-code founders get unstuck fast :rocket:save hours, & ship faster with an expert :man_technologist: on-demand

Will you be storing data, like stock levels, against this?

So do you need them all set up in advance?

Thanks for the reply.

I actually need to leave it dinamic so they can put the option names and option values they want.

Not quite… i was trying to do that with just custom states before i save them in the database but as i could not get that done. thought would be easiear saving and changing the data along the way.

Create a data type called Variant where you store fields like: size, color, material etc.

Then you can connect the data type Product with Variant by creating a field in Product that belongs to Variant.

You can create in workflow a Variant record/entry with the values provided by the user and when creating the Product record/entry add that Variant here.

Is this what you are looking for or I have misunderstood your problem?

Hi… thank you for the reply.

I’ll try to be more specific…

This is the Popup i have… i already have my database set up with table for products and a table for variants and got them related. i can create products and variables and make changes to them no problem there.

On this above image, is what happens at first, the user can dinamically add “Option Names” and “OptionValues”… there is an input just visible for test, showing how many possible variables that would create up to now.

For the first set (there’s a total of 3 sets) i can create those 3 variables when they hit “done” .

Now on this above image, they added a second set of variables… “Color”… and the input shows that now i should have 9 possible variables mixing the first and the second sets.

and the problem starts there… when they hit done again for the second… i can ok make a change to the former 3 created, but them i have to create another 6. to hit the possible 9.

Things get complicated here. i can creat for example.

Small/Blue, Large/Blue, Medium/BLue… in make a change doing a search for a first item.

but also i should create… smal/black, medium/black, large/black… and … smal/red, medium/red and large/red… and so on

If i have a set of 3 (wich is the max) i would have 27 possible combinations.

So basically my question is about on how can i create those combinations.

Thank you