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.

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
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (3,435)