cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Filter selection from multiple combo boxes

Hey, I'm new to Power Apps, and I'm still trying to figure out how everything works.

 

I have 3 combo boxes each connected to the same data source, a first, second, and third option for the user to select. I have tried using a variation of this for each combo box:

 

 

 

Filter(
    Choices([@DataSource].'Option 1'),
    'Spots Open' > 0,
    Not(DataID = DataCardValue1.Selected.DataID),
    Not(DataID = DataCardValue2.Selected.DataID)
)

 

 

 

But it keeps giving me a circular reference error. How can I make it so that when one item is selected from a combo box, it filters that choice out from the others?

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Filter selection from multiple combo boxes

Thanks @Anonymous ,

That certainly is a circular reference.

Like Excel, you cannot have two objects referring to each other - I am also surprised that box 2 is not circular to 1 as they refer to each other as well.

However something may be possible with variables.

On the OnSelect of each box - put this (obviously change the numbers).

UpdateContext({vChoice1:DateCardValue1.Selected.Value})

Then your code

Filter(
    Choices([@DataSource].'Option 1'),
    'Spots Open' > 0 &&
    DataID <> vChoice2 &&
    DataID <> vChoice3
)

Filter(
    Choices([@DataSource].'Option 2'),
    'Spots Open' > 0 &&
    DataID <> vChoice1 &&
    DataID <> vChoice3
)

Filter(
    Choices([@DataSource].'Option 3'),
    'Spots Open' > 0 &&
    DataID <> vChoice1 &&
    DataID <> vChoice2
)

The only problem with the process is that box 1 cannot test 2 and 3 until they have been completed and box 2 cannot test 3 until it has been completed.

 

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

Re: Filter selection from multiple combo boxes

Hi @Anonymous ,

What are the Items property for the other two ComboBoxes and what are their names?

 

Highlighted
Anonymous
Not applicable

Re: Filter selection from multiple combo boxes

Filter(
    Choices([@DataSource].'Option 1'),
    'Spots Open' > 0,
    Not(DataID = DataCardValue2.Selected.DataID),
    Not(DataID = DataCardValue3.Selected.DataID)
)

Filter(
    Choices([@DataSource].'Option 2'),
    'Spots Open' > 0,
    Not(DataID = DataCardValue1.Selected.DataID),
    Not(DataID = DataCardValue3.Selected.DataID)
)

Filter(
    Choices([@DataSource].'Option 3'),
    'Spots Open' > 0,
    Not(DataID = DataCardValue1.Selected.DataID),
    Not(DataID = DataCardValue2.Selected.DataID)
)

These are the Items of the three combo boxes. They just have their standard names: DataCardValue1, DataCardValue2, and DataCardValue3. I understand why it's a circular reference, I just want to know if there is a way of doing it without getting that error

Thank you

Highlighted
Super User III
Super User III

Re: Filter selection from multiple combo boxes

Thanks @Anonymous ,

That certainly is a circular reference.

Like Excel, you cannot have two objects referring to each other - I am also surprised that box 2 is not circular to 1 as they refer to each other as well.

However something may be possible with variables.

On the OnSelect of each box - put this (obviously change the numbers).

UpdateContext({vChoice1:DateCardValue1.Selected.Value})

Then your code

Filter(
    Choices([@DataSource].'Option 1'),
    'Spots Open' > 0 &&
    DataID <> vChoice2 &&
    DataID <> vChoice3
)

Filter(
    Choices([@DataSource].'Option 2'),
    'Spots Open' > 0 &&
    DataID <> vChoice1 &&
    DataID <> vChoice3
)

Filter(
    Choices([@DataSource].'Option 3'),
    'Spots Open' > 0 &&
    DataID <> vChoice1 &&
    DataID <> vChoice2
)

The only problem with the process is that box 1 cannot test 2 and 3 until they have been completed and box 2 cannot test 3 until it has been completed.

 

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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,514)