cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
powerapps890
Post Prodigy
Post Prodigy

Add All to combobox

ClearCollect(
col,
{Result: "All"}, Sort(Distinct(CCB, 'Functional Area'), Result)
) This is what i have onvisible for browsescreen1. 

Then in the combobox1 i have col in items. It says all in the combo box but there is no data when i choose all, it is just blank. How do i get all of the records to come up under all. 

 

Filter(
CCB,
If(
IsBlank(ComboBox1.SelectedItems),
true,
'Functional Area' in ComboBox1.SelectedItems
),
If(
IsBlank(Filter.Text),
true,
StartsWith('Requirement Source',Filter.Text)
),
If( // Add formula here
IsBlank(Search_.Text),
true,
StartsWith(Name, Search_.Text)
)
)

This is how my gallery sorts its items.

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

@powerapps890 ,

I assume you are looking to put "all" at the front of a list for a drop-down. You need

ClearCollect(
   col,
   {Result: "All"}
);
Collect(
   col,
   Sort(
      Distinct(
         CCB, 
         'Functional Area'
      ), 
      Result
   )
)

then for the Filter

Filter(
   CCB,
   If(
      IsBlank(ComboBox1.Selected.Result) || ComboBox1.Selected.Result = "All",
      true,
      'Functional Area' in ComboBox1.SelectedItems
   ) &&
   If(
      IsBlank(Filter.Text),
      true,
      StartsWith('Requirement Source',Filter.Text)
   ) &&
   If(
      IsBlank(Search_.Text),
      true,
      StartsWith(Name, Search_.Text)
   )
)

 

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.

View solution in original post

3 REPLIES 3
WarrenBelz
Super User
Super User

@powerapps890 ,

I assume you are looking to put "all" at the front of a list for a drop-down. You need

ClearCollect(
   col,
   {Result: "All"}
);
Collect(
   col,
   Sort(
      Distinct(
         CCB, 
         'Functional Area'
      ), 
      Result
   )
)

then for the Filter

Filter(
   CCB,
   If(
      IsBlank(ComboBox1.Selected.Result) || ComboBox1.Selected.Result = "All",
      true,
      'Functional Area' in ComboBox1.SelectedItems
   ) &&
   If(
      IsBlank(Filter.Text),
      true,
      StartsWith('Requirement Source',Filter.Text)
   ) &&
   If(
      IsBlank(Search_.Text),
      true,
      StartsWith(Name, Search_.Text)
   )
)

 

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.

View solution in original post

v-bofeng-msft
Community Support
Community Support

Hi @powerapps890 :

Do you want to select all records when the user selects "All".

My method is to detect the choices in the combox, and if the user selects "all", reset the combox so that it selects all options by default.I've made a test for your reference:

1\Set the combo box's

OnChange:

 

If({Result: "All"} in ComboBox1.SelectedItems,Set(all,true);Reset(ComboBox1)) /*all is my custom variable*/

 

DefaultSelectedItems:

 

If(all=true,Distinct(CCB, 'Functional Area'))

 

B1.gif

Best Regards,

Bof

 

Thank you @v-bofeng-msft for the (slightly) alternate view.

@powerapps890 , please tag what ever direction suits your model.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,844)