Forum Academy Marketplace Showcase Pricing Features

How to make custom state list from 3 different dropdown

I have 3 dropdown’s with different data type’s
for example :
dropdown1 = “color” data type (Red,Blue,Green)
dropdown2= “size” data type ( S,M,L)
dropdown3= “fabric” data type ( Leather ,Satin ,Linen)

i want to make a “custom state list” to “add and remove” what users have chosen from these dropdowns to custom state.
like when user select
dropdown1 = current value = Red
dropdown2 = current value =S
dropdown3 = current value =Leather
the custom state list will be (red, s, leather)

when user change dropdown1 = current value red to blue
will remove the previous value " red " and add " blue "
to become the custom state list is (blue, s, leather)

is anybody can figure out how to make this work?

What’s the use case here? (i.e. why do you need to add the selected items to a custom state rather than just using the dropdown values directly?)

Obviously you can’t mix different datatypes in a single custom state (a custom state has one ‘type’), but you could use a ‘text’ custom state to save a specific field of each datatype as a list of texts. Then you could search for those things by that field as and when you need to (but it would be simpler to just refer directly to the chosen values from the dropdowns the dropdown).

To save the Item’s names (for example) you’d need to run the same workflow whenever each of the dropdown menu’s value changes (maybe use a custom event for this), that sets the list of texts to the value of each dropdown’s specified field (in the correct order).

Use something like this as the value to set the custom state to:

custom state's list: minus list (custom state's list):plus item (dropdown 1's value's Name): plus item (dropdown 2's value's Name): plus item (dropdown 3's value's Name)

Alternatively, instead of a single custom state as a list, why not just have 3 separate custom states, one of each type, and set it accordingly (although again, I can’t see what you’d be gaining there over just using the dropdown values directly).

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