cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
golfnutt82
Super User
Super User

Filtering List Data Based on a ComboBox Selection

Hello,
I have a list and I want to filter and display the data based on a combobox choice.
However, when I try to do this I am getting an error.
You will notice that I am attempting to create a variable as well to use on other data to display as a result of the search result.
The "Role" field in the "Roles" List is a text field that is updated after a workflow runs.
The combobox field is grabbing the list column data.

 

golfnutt82_0-1634663504528.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@golfnutt82 

You cannot use the Choices function on a Text column.  If you are looking for distinct values, then use the Distinct function:

    Filter(Distinct(Roles, Role), ComboBox2.SearchText in Result)

 

You really don't need a variable for this as your control already serves as a dynamic variable that will already contain the information you need.

 

I hope this is helpful for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

4 REPLIES 4
RandyHayes
Super User
Super User

@golfnutt82 

You cannot use the Choices function on a Text column.  If you are looking for distinct values, then use the Distinct function:

    Filter(Distinct(Roles, Role), ComboBox2.SearchText in Result)

 

You really don't need a variable for this as your control already serves as a dynamic variable that will already contain the information you need.

 

I hope this is helpful for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi Randy,
Thanks for the reply.
I received this error.

golfnutt82_0-1634666967135.png

In the OnChange event on a separate form, I use the following to populate other fields when a choice is made from a lookup which I was trying to use with a combo box.

golfnutt82_1-1634668028538.png


How could I display other list data on the form when a choice is selected if I am not able to use a variable as I was able in my other form?

RandyHayes
Super User
Super User

@golfnutt82 

Well first, you can use a variable, but I was stating that you don't need a variable as your source control already has what is needed.  A variable would just be a static snapshot that you need to maintain in your app.

 

As for the formula...re-read what I wrote for the formula - you are missing a closing paren.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Thanks, missed that.
I appreciate your assistance.

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

Check out the New Ideas Site

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

Top Solution Authors
Top Kudoed Authors
Users online (3,032)