cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RMeena_9
Resolver I
Resolver I

How to display remaining contents of 1st combo box into 2nd combo box

Hi All,

 

Currently I am trying to build a logic where two combo box's having same contents in both - 2nd combo box should be able to display only not selected items from 1st combo box.

 

Lets say I have 10 items, If I select 4 items in 1st combo box then in 2nd combo box it should display remaining 6 items alone.

 

I couldn't able to find related Inversion or logic on how to satisfy this. 

Any suggestions please ??

 

Thank you in advance

1 ACCEPTED SOLUTION

Accepted Solutions
RMeena_9
Resolver I
Resolver I

Hi All,

 

I used collect to filter the contents of combobox1 and 2

 

I filled On Visible property of the combo box's screen with below code.

ClearCollect(GateT,Filter(Gate_Table_1,Gate = Dropdown2.Selected.Result).WorkProductName)

and

Filled ComboBox1 with ->

Items = GateT, 

OnChange property = ClearCollect(GateNewT,GateT); Remove(GateNewT,ComboBox2_1.SelectedItems);

 

and Combo box2 with items = GateNewT

 

It worked!!!! 🙂

 

Thank you all for your response.

View solution in original post

8 REPLIES 8
TheRobRush
Super User
Super User

Simple example

 

ComboBox1 Items

[1,2,3,4,5,6,7,8,9,10]

 

ComboBox2 Items

Filter([1,2,3,4,5,6,7,8,9,10], Not(Value in ComboBox1.SelectedItems.Value))
_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!

Hi @TheRobRush,

 

I am getting below error. My combo boxes are doesn't have constant items they change based on other dropdown selection. If I try above formula it is showing error near Value in 2nd combo box 

RMeena_9_0-1656951195208.png

 

Drrickryp
Super User
Super User

@RMeena_9 

Shouldn't that be Result instead of Value?

TheRobRush
Super User
Super User

Yah if your combobox is running off something like a distinct and your values are results, not values, you will need to change that part. 

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!
TheRobRush
Super User
Super User

.

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!

Hi @TheRobRush,

 

I have tried with Result but it doesn't work. But I used below With function it is not showing any errors but it is not filtering the 2nd combobox with remaining items some items are still displaying in the list.

 

With(
{UserTasks1:
Filter(
Gate_Table_1 ,Gate = Dropdown2.Selected.Result).WorkProductName
},
Filter(
UserTasks1, Not(WorkProductName in ComboBox2_1.Selected.WorkProductName)
)
)

Hi @RMeena_9 ,

Assuming the With() statement is the Items filter of the first Combo Box, this should work

With(
   {
      UserTasks1:
      Filter(
         Gate_Table_1,
         Gate = Dropdown2.Selected.Result
      )
   },
   Filter(
      UserTasks1, 
      !(WorkProductName in ComboBox2_1.SelectedItems.WorkProductName)
   )
)

 

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.

Visit my blog Practical Power Apps

RMeena_9
Resolver I
Resolver I

Hi All,

 

I used collect to filter the contents of combobox1 and 2

 

I filled On Visible property of the combo box's screen with below code.

ClearCollect(GateT,Filter(Gate_Table_1,Gate = Dropdown2.Selected.Result).WorkProductName)

and

Filled ComboBox1 with ->

Items = GateT, 

OnChange property = ClearCollect(GateNewT,GateT); Remove(GateNewT,ComboBox2_1.SelectedItems);

 

and Combo box2 with items = GateNewT

 

It worked!!!! 🙂

 

Thank you all for your response.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

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