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

Notifications

Announcements

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:
I have the same question (0)
  • 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard