Dynamically change the display name of a dropdown

Is it possible to change the display name of a dropdown using conditions without having to add attributes to the option set? For example, can I set a condition that checks the user’s profile and the current dropdown value, and then sets the display name of the dropdown’s selection based on those conditions?

I don’t want to change the Dropdown source, I want to change individual display names within the dropdown based on User settings.

could you provide an example of what you are trying to achieve?

Sure, imagine in the first dropdown you have 100 different ‘Profile’ names and you have chosen “Halo”, then in the second dropdown you see filtered options “Item 1, Item 2 …”

But suppose in the first dropdown you select a ‘Profile’ name “Hyagen” , now I need to change some of the filtered options, so Item 3 may change to something like “Item 1, Item 2, Pantha, Item 4 …”

I know this seems odd but it makes sense in the scope of my app. I have 400+ options in my option set so I’d prefer to do this on the front end if possible rather than adding attributes to the option set.

SIdeally I want to say When Users 'Profile' name "Hyagen" and the dropdown Name is Item 3, then change the display name to Pantha

Hi Darren,

Just joining this conversation as you mentioned you use 400+ options in an OS.

OS are loaded on every page, even if you don’t use that Option Set on a certain page, it will be rendered and may decrease your overall app performance.

I’d recommend switching to a custom Data Type if this makes sense to what you’re trying to achieve.

Thanks @oliviercoolen I am using a single page app so I assume once it’s loading the first time then it won’t need to reload when a user clicks from group to group (pages are ‘groups’ in the SPA)

Ok guys, I don’t think it’s possible to dynamically change the display name of a dropdown in the way I wanted so I added a single Yes/No attribute to the option set called “include_this_when_showALL”. Now, when there is a name which is specific to a single Profile I set it to ‘No’. The dropdown then shows all with Yes by default, but when you select a Profile it will show only those with Yes. That probably makes no sense to anyone reading this but it’s solved my issue good enough!