@Alex.Vartzbed posted a new topic, subject "Text form Dropdown into button?". It read:

   I'm trying to take the selected text from a dropdown menu (NameList_1) and put it into a button.
    
    so if my dropdown list is this:
    
    {  
    "Name 1": 0,  
    "Name 2": 1,  
    "Name 3": 45,  
    "Name 4": 23,  
    }
    
    and from the dropdown I select Name 3 I want a button that's next to it, to also show this same text.
    
    I cannot for the life of me figure this out.
    
    the problem is that I need to use the dropdown index and not the value of the dropdown as the value of the names as you can see is not strictly 0,1,2,3,4,5 but is a random number.
    
    thank you!
    
    Alex

To which @jean-emmanuel (Jean Emmanuel) replied

    [code]
        JS{
        // this goes in the button's label
        var values = @{dropdown_id.values},
            v = @{dropdown_id}
        
        return Object.keys(values).find(k => values[k] == v)
        
        }
        
    [/code]
    
    dropdown_value.json (3.0 KB)

To which @Alex.Vartzbed replied

    Thank you so much for this ... but .. would you be angry if I told you I'm still running v1.0.3?
    
    Is this a possibility in v1.0.3?
    
    thank you!

@jean-emmanuel (Jean Emmanuel) replied

    I think the only difference in this case would be to write `JS{{ code }}` instead of `JS{ code }`

So @Alex.Vartzbed replied

    this worked like a charm! Thanks Jean!!!


{'source': 'discourse', 'url': 'https://openstagecontrol.discourse.group/t/text-form-dropdown-into-button/1870', 'title': 'Text form Dropdown into button?', 'views': 111, 'has_accepted_answer': False, 'word_count': 206, 'like_count': 0, 'reply_count': 2, 'participant_count': 2, 'posts': 5, 'tags': '', 'author': '@Alex.Vartzbed', 'participants': '@Alex.Vartzbed, @jean-emmanuel (Jean Emmanuel)', 'image_url': [None], 'created_at': '2021-10-16T08:26:39.711Z', 'last_posted_at': '2021-10-16T12:33:33.834Z'}