cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Super User III
Super User III

@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
Highlighted
Super User III
Super User III

@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

Highlighted
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

 

Highlighted

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

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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,584)