web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Power Apps ComboBox
Power Apps
Unanswered

Power Apps ComboBox

(0) ShareShare
ReportReport
Posted on by 4


Lets say that I have list of choices called "Source1", "Source2", "Source3", "Source4" and "Source5" in my combobox. When I choose "Source1", I want that the value of my label1 to set to 100. When I choose for example "Source1" and "Source2" I want to have 2 labels where label1 will be 100 because I have chosen source1 and label2 will be 200 because I have chosen also source2.

 

I tried to do it changing OnChange property of the combobox, putting here next things

UpdateContext({ItemVal1: If(chbsources.Selected.Value= "Source1";100;0)});;
UpdateContext({ItemVal2: If(chbsources.Selected.Value= "Source2";200;0)})
where ItemVal1 is text value of label1 and ItemVal2 is text value of label2.

 

But I didn't get result that I want.When I chose Source 1 and Source 2 I wanted to have 2 values where label1=100 and label2=200. But I got label1=0 and label2=20011.jpg. How can I do it?

Categories:
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @akmaralnassir In a Combobox when you want to check for ALL selected values, you must use chbsources.SelectedItems property. Because you are using chbsources.Selected.Value, it will check only the last selected item. Change your formula to,

    UpdateContext({ItemVal1: If("Source1" in chbsources.SelectedItems;100;0)});;
    UpdateContext({ItemVal2: If("Source2" in chbsources.SelectedItems;200;0)})

    Hope that helps. 

  • akmaralnassir Profile Picture
    4 on at

    No, it is returning me 056666.jpg

  • akmaralnassir Profile Picture
    4 on at

    Thank you it is working with this code 

    UpdateContext({ItemVal1: If("Source1" in chbsources.SelectedItems.Value;100;0)});;
    UpdateContext({ItemVal2: If("Source2" in chbsources.SelectedItems.Value;200;0)})

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @akmaralnassir Glad it works! 😊

     

    Please remember to give a  👍 and accept the solution as it will be help others in the future.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 223

Last 30 days Overall leaderboard