Forum Academy Marketplace Showcase Pricing Features

Dynamically select attribute in other Option Set

Hi,

not sure how to resolve this in bubble and my searches also didn’t help.

Situation:

I have two Option Sets (these values are static and never change):

Option Set “Default string”: this is like a dictionary that contains default strings for every “Platform” based on the generic default string name
Attributes:

  • Display: Contains generic string (example option: “My String”)
  • Platform A: Contains string used in Platform A (example option: “my_string”)
  • Platform B: Contains string used in Platform B (example option: “myString”)
  • Platform C: Contains string used in Platform C (example option: “fubar”)
  • Platform N Contains string used in Platform N (example option: “someotherweirdstring”)

Option Set “Platform”: this is contains different attributes about different platforms, one of which is the platform name
Attributes:

  • Display: Contains the platform name (example option: “Platform A”)
  • Other attributes: (not relevant here)

Now I have 2 Drop-Downs:
Drop-Down A is of type Default string (shows Default string’s Display value)

Drop-Down B is of type Platform (shows Platform’s Display value)

Problem:
If I select Option “My String” in the 1st Drop-Down and “Platform C” in the 2nd Dropdown, I’d like to retrieve the value for Default String → Platform C (i.e. “fubar”).

How would I do that?

Also open to another Option Set structure if necessary.

Thanks for your help!

Hi there, @Sascha… if I understand your post correctly, one way you could go is to get rid of the platform attributes on the Default string option set and add a third option set to the mix. The new option set would have the resulting strings (my_string, myString, fubar, etc.) as its options (display values), and it would have attributes that are tied to the other two option sets. With that setup in place (and after you have defined all of the attributes on the new option set, of course), it would be easy to return the resulting string you want with this expression.

Anyway, that’s one way you can go here, and I hope it helps.

Best…
Mike

Thanks for your reply @mikeloc

The new option set would have the resulting strings (my_string, myString, fubar, etc.) as its options (display values), and it would have attributes that are tied to the other two option sets.

I have maybe 50 different options in the “Default String” Option Set. For example, in addition to the option “My String” (and it platform specific counterparts), there could be “My second String”, “My other string”, and so on (and for each of them the platform specific counterparts in the respective attributes)

I guess your approach would mean to create 50 Option Sets. Then there is the problem how to select the right option set based on the Drop-Down value.

Uh, no… definitely not. :slight_smile:

You should only need three option sets… the two you already have and a new one that defines each resulting string and its connection to a default string and a platform. Does that make sense? If it doesn’t, I can post some screenshots of what I am talking about to see if I actually do understand your post.

1 Like

Thanks for clarifying. This seems to actually work.

So I’ve set it up this way:

Option Set: Default String

  • Display: contains the default string

Options Set Platform

  • Display: Platform name

Option Set: Resulting String

  • Display: contains all resulting strings as options
  • Default String: List of Default Strings
  • Platform: List of Platforms

I set the these last attributes as lists, as sometimes the resulting strings are identical for different default strings or platforms.

From the original problem this seems backwards at first and I have to test a few edge-cases, but it seems to work. Thank you @mikeloc

Edit: formating

1 Like

Yup, that’s what I was talking about, and I was actually wondering if you could make those attributes lists to cut down on some of the options. Good stuff, @Sascha.