How do I insert the values of two other text lists into a text list?


I have this table, and the data is saved like this in a text list:

:variation1:variation2:p-:q-:s-:

p- (price)
q- (quantity)
s- (SKU)

image
I want that when the user clicks add, the values of these two inputs come together and fill the table, in this format:

:verde:P:p-:q-:s-:
:verde:M:p-:q-:s-:
:verde:G:p-:q-:s-:
:verde:GG:p-:q-:s-:
:amarelo:P:p-:q-:s-:
:amarelo:M:p-:q-:s-:
:amarelo:G:p-:q-:s-:
:amarelo:GG:p-:q-:s-:
:azul:P:p-:q-:s-:
:azul:M:p-:q-:s-:
:azul:G:p-:q-:s-:
:azul:GG:p-:q-:s-:

Any ideas on how to do this?

1 Like

Hello @douglasnqb

  • Use :split by with the delimiter being “:” to get the two lists (list1 being the colors and list2 being sizes … both texts)
  • Nested looping. You will loop through list 1 items and for each item of list1 … loop through each of the items in list 2 … creating each of the texts as indicated in your post
1 Like

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