Problem with displaying options in select module from sub-array

Hi Community,

can someone help get my select module up and running?

I have this data structure in Xano, which is loaded as collection in WeWeb:

  • Product A
    ** Variant 1 (size: S; color: green)
    ** Variant 2 (size: M; color: green)
    ** Variant 3 (size: L; color: green)

  • Product B
    ** Variant 1 (size: S; color: blue)
    ** Variant 2 (size: M; color: green)
    ** Variant 3 (size: L; color: yellow)

Variants are arrays nested in the product items:

I am now trying to use that data in a select element in WeWeb, but I can’t get the variants array to be displayed in the select-options.

Here is what I did:

  1. I did bind the product array in the options of the main element of the select module

  2. The option text, I did bind to the variants (concatenate size and color) from the variant array in the item.data.

However, no options are displayed yet:

I assume the formula in step 2 is wrong. Can someone help me get it right so all variant values will be avaiable in the options?

Hey @chaefner :wave:
The binding of the options will happen just below the Options settings of the Select component :slight_smile:
CleanShot 2024-07-26 at 16.05.20

But to achieve the same label, you’d need to rework the bound data a little bit.

1 Like

Hey @jptrinh .

Thanks, that worked. However, It seems like for this field, there is no option to display the output via formula. I can only select a single value here. If thats the case, I would have to create an additional value in the database. Also ok, just need to know it.

Bildschirmfoto 2024-07-28 um 19.02.44

I think you shoukd manipulate the data via a formula bound to options, before setting the label, value etc.

You should flatten it before binding basically, as there is no way to do this for now I think.

1 Like