Creating Option Set data item type

Hey! Head is melting here. I want to use a combination of two (user) input fields to pull out an attribute of an option set. An example might make that a bit clearer.

User selects a start month of ‘February’ and frequency of ‘Quarterly’ from drop down lists.

I have an option set called Opt_Mth_Freq. I have an option within that set called FebruaryQuarterly with an attribute (Att_ListOfMonths) which is a list of months.

I want to feed the list of months corresponding to FebruaryQuarterly into my database. I think I need to somehow create an Opt_Mth_Freq data item from my user inputs so I can then call the attribute. But how can I create this data type from the two inputs I have?

Thanks!
Steve.

Hi there, @stevoster… if I understand your post correctly, it seems like you could accomplish what you described by adding two more attributes to the Opt_Mth_Freq option set. One of the attributes would be linked to the Option_Months option set, and the other attribute would be linked to the Option_Frequencies option set (I know those option sets exist because of your other post on this topic).

With those attributes in place, you could access the list of months corresponding to the FebruaryQuarterly option with an expression that gets all of the options from the Opt_Mth_Freq option set and then filters the set to the option where the month and frequency attributes match the dropdown selections. So, something like this…

Once you have filtered the set to the specific option you need, you can reference the option’s Att_ListOfMonths attribute and save those months to a field in the database.

Hope this helps.

Best…
Mike

1 Like

Hi Mike! Wow, massive thanks for taking the time to think about this (and even recreate my scenario from this post and the previous one!). I followed your suggestions, messed up a few times along the way (my bad, not yours :grin:), but I got this working, genuinely thrilled. You have made my day. If there is some way to gift you a pint / cup of coffee please let me know!

Thanks again. I really appreciate the help, would never have figured that out and it has also helped me understand how bubble thinks.

Steve.

1 Like