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 / Check box with Combo B...
Power Apps
Unanswered

Check box with Combo Box - Formulae help !

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

In a powerapp , I have a two combo boxes and a check box

1 . 'NewComboBox' with values : Site , Supplier , City 

2. 'ComboBox_Bcc' which is a drop down depends on selection in NewComboBox . e.g If point 1 is City, Point 2 displays all City names.

3. 'CheckBox1' , when checked , it gets distinct values of NewComboBox into Bcc combo box.  

   E.g If NewCombox = City , and CheckBox1  is checked, then all City's will be selected into Bcc_combobox.

 

Issue :

A. When i select NewComboxBox = Site and Check the 'CheckBox1' , it is selecting all Site Names as expected .

B. When i select NewComboxBox = Supplier and Check the 'CheckBox1' , it is selecting all Supplier Names as expected .

C. But when newcombobox = City , and when i check 'CheckBox1' , it doesnt select any city names , though city names are listing in drop down on bccComboBox.

 

Here is the script i am using for the 'OnSelect' : (CheckBox1): 

If(Checkbox1.Value,Set(Glob,Distinct('Site Admins',If(NewComboBox.Selected.Value = "Site",'Site Name', NewComboBox.Selected.Value = "Supplier",Supplier, NewComboBox.Selected.Value = "City",City) ) ),Set(Glob,Blank()))

 

Glob is a value in 'defaultselecteditems' in ComboBox_Bcc.

 

The visual looks like below where you can see , Point A, B works as expected but Point C is not selecting any values in Bcc.

May i know what wrong in my formulae where only City specific values are not being selected into Bcc when i check 'Checkbox'

 

del-powerapps-case.png

 

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    Hi @dsab81 ,

    Using your structure, this might work.

    If(
     Checkbox1.Value=true,
     Set(
     Glob,
     Distinct(
     'Site Admins',
     Switch(
     NewComboBox.Selected.Value,
     "Site", 'Site Name', 
     "Supplier", Supplier, 
     "City", City
     )
     )
     ),
     Blank()
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • dsab81 Profile Picture
    Microsoft Employee on at

    Your formulae works just like mine. Checkbox works as expected when we newcombobox = site or supplier, but when newcombobox = city , it behaves the same like my formulae. 

  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    Hi @dsab81 ,

    For a bit of debugging, do this

    Set(
     Glob,
     Distinct(
     'Site Admins',
     City
     )
    )

    then go View > Variables and see what is in Glob.Result.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • dsab81 Profile Picture
    Microsoft Employee on at

    I get the city names in the variables

    dsab81_1-1598510564438.png

     

     

  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    @dsab81 ,

    I have seen this before with dynamic Items in a control - valid values that do not display reliably.

    Are your checkbox Items set to Glob.Result?

  • dsab81 Profile Picture
    Microsoft Employee on at

    thanks for responding quick and helping !

    Yes , u r right.. not sure why dynamic values of just the 'city' is not showing up though drop down/variable clearly have values. . I have plans to add 'country' and few other drop downs for selection in future and wish i know how to resolve this to move further.

     

    Regarding your question, i dont see item property in check box . where do you want me to check? . I am sure i haven't glob.result any where. 

  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    @dsab81 ,

    Sorry -mistype - I meant Combo Box

  • dsab81 Profile Picture
    Microsoft Employee on at

    No. My ComboBox 'items' was set to below, and my defaultselecteditems is set to 'Glob'. 

     

    Good news is that when i set 'items' to glob.result , i am able to 'select all' values from city . But problem is that , it lost the property of listing down values in drop down (like it lists down values as shown in pic in my first post) and when i clicking on the combobox drop down, it doesnt do any thing.

     

    Please let me know how can we make both check box and also be able to list values from drop down ?

     

    Items Property:

    Distinct(
    'Site Admins',
    If(
    NewComboBox.Selected.Value = "Supplier",
    Supplier,
    NewComboBox.Selected.Value = "City",
    City,
    NewComboBox.Selected.Value = "Site",
    'Site Name'
    )
    )

  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    Hi @dsab81 ,

    I am not quite sure of your structure, but if you put this on the OnCheck of the Checkbox

    Set(
     Glob,
     Distinct(
     'Site Admins',
     Switch(
     NewComboBox.Selected.Value,
     "Site", 'Site Name', 
     "Supplier", Supplier, 
     "City", City
     )
     )
    )

    and this on the OnUncheck

    Set(
     Glob,
     {Result:Blank()}
    )

     and have the Items to Glob.Result, would that do what you require?

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard