How do I apply it to all inputs field?

I want the value contained in the input (preço) to be applied to all price inputs when I press the (Aplicar a todos) button.

I’m trying to make a system where you can register products, with variations, but I’m having a hard time doing it, I’m having trouble using tables and accessing the data within them.

I want to allow the user to have two variations that he can choose from, such as size and color, color and print, whatever he wants.

I don’t know if my explanation will work with tables, as I’ve never used them. But here’s what I’d do.

-Create a custom state “Aplicar a todos?” (yes/no)
-Give the “aplicar a todos” button a workflow that will set state of “Aplicar a todos?” to “yes”.
-Give all the inputs a conditional that will set their initial value to the input value of Preco when “aplicar a todos” is yes

Hope that helps! :slight_smile:

It worked, but if the user updates the value of the input (preço), the state (aplicar a todos?), which is still set to yes, will update all the inputs, without pressing the button (aplicar a todos) and that’s not very nice.

This brings me to my second problem, each input of the variation that stores the price is inside a table and this table is inside a table called (Table variations), and I don’t know how to access the value of these inputs, they’re not visible in the workflow, probably because it’s a table inside another table, I’m thinking of storing the value of these inputs in states, but I don’t know how I’m going to do it, do you have any idea how to do it?

To solve this, create a new custom state “Global Prices” that will hold the price you want for every input. When you click on “aplicar a todos”, that button will set the state of “Global Prices” to the input’s value. Changing the input of Preco won’t affect “Global Prices” until you click the button again. You should also be able to delete the custom state “Aplicar a todos?” since you don’t need it anymore

Change the conditional of the inputs to be when “Global Prices” is not empty, set the initial value of “Global Prices” instead.

For your other issue, are you able to access the inputs in a workflow that is “do when input value is changed” or are they not accessible? If you can, then set the state that is somewhere accessible every time the input value is changed.

I can actually access when an input is changed. I thought about creating a state (global prices), but supposing I had the following variations:

Variation 1 = Color
Variation 2 = Size

Color - Size - Price

Red - 35 - 129.90
Red - 36 - 139.90
Red - 37 - 149.90

Blue - 35 - 129.90
Blue - 36 - 200.00
Blue - 37 - 259.90

If I leave (global prices) as a list, so far I think I can do it, but look:

(global prices)
[1] = 129.90 | Red 35
[2] = 139.90 | Red 36
[3] = 149.90 | Red 37

[6] = 259.90 | Blue 37

As variation 1 (Color) has two items (Red, Blue), it creates two tables containing 3 items (Size)

Table 1 ( Red )
Size 35 = 129.90
Size 36 = 139.90
Size 37 = 149,90

Table 2 ( Blue)
Size 35 = 129,90
Size 36 = 200,00
Size 37 = 259,90

If I change the price of the element (Blue) (Size 36), I need to change the value that is in index 5 of (global prices), but within table 2 (Blue) the index of this element is 2, I don’t know if I can access which table it is in, to be able to adjust its index, apart from this problem, from the little I used list I don’t remember being able to insert equal values, the only way to have equal values, was to first add a different value and then change its value. Do you have any ideas on how to solve this problem? Or a more efficient solution for creating products with variations?

Okay, I definitely want to help you, but I am a bit confused as to what exactly you would like to achieve.

-What exactly is the table for? Is it a form to create a new product that has multiple variations? Or is it a form to buy products? Run me through exactly what the process is.
-Why do you want to make Global Price a list?

Let’s solve this

I’m trying to make a product registration form with multiple variations, but I don’t know how to do it.

This topic was automatically closed after 70 days. New replies are no longer allowed.