cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Searching/Filteringon multiple conditions

I have the following in the "Items" formula of a dropdown list. 

 

1.)

ShowColumns(Search(Search(Search(TotalCasignTable, CasignOD.Text,"OD"), CasignWeight.Text,"Weight"), CsgGrade.Text, "Grade"),"ID")

2.)

ShowColumns(Filter(Filter(Filter(TotalCasignTable, OD = CasignOD.Text), Weight = CasignWeight.Text), Grade = CsgGrade.Text),"ID")

 

part of my table is attached.

I am trying to pull an ID value based on 3 conditions. OD, Weight, Grade but the above formulas are not working for me. I have even attempted to create a unique ID for each row by concatenating (OD,Weight,Grade) and using:

 

ShowColumns(Filter(TotalCasignTable, Description = lookvalue.Text), "ID")

 

in the "Items" property of a dropdown list (where lookvalue is the concatenated label). 

this works in excel but I cannot seem to make it work for me in PowerApps.

 

Please help!!

 

6 REPLIES 6
Highlighted
Super User
Super User

Re: Searching/Filteringon multiple conditions

Just a few questions before I post one of my suggested solutions: 

 

1. Are you trying to populate a dropdown of IDs based on the values a user enters for Weight, Grade, and OD? 

2. Or are you trying to display ID based on values selected or entered by users for Weight, Grade, and OD? 

 

In the example I am attaching, I have users enter values for Weight, Grade, and OD. And then the value of ID is displayed based on the values entered. 

 

I believe the problem in your expressions is multiple searches or multiple filters. While you can definitely do multiple searches or multiple filters, you can do that within one single search function or one single filter function. You need to nest the condition as shown below: 

 

Filter(IDList, OD = Value(TextInput1.Text), Weight = Value(TextInput1_1.Text), Grade = TextInput1_2.Text)

 

If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit(Haman)

 

 

 

Highlighted
Regular Visitor

Re: Searching/Filteringon multiple conditions

@PowerAddict 

thanks for your reply!

 

ultimately, my goal is to display the ID value from the table (based on OD, Weight, Grade) and use this to perform calculations based on additional user inputs. (i was planning on doing this by changing the display mode setting on the dropdown item to "view").

 

I used your formula and I got the yellow triangle with error saying "incompatible type. we can't evaluate your formula because the values being compared in the formula are not the same."

 

As a result, I thought the problem might have been with the classification of my data in my table. I went to my data source and edited the OD & Weight column values from "General" to "Values" and the Grade Column values from "General" to "text" and still no solution. 

 

not sure if part of my problem is with my actual data source table. i noticed that when i click next to the table in the formula bar it says "we didn't find any data". but it still recognizes the table as it gives it to me as a option in the row below (see attached).

Highlighted
Super User
Super User

Re: Searching/Filteringon multiple conditions

Was the formula in the attached image the text property of a label? If you hover over the red line, what does the error say? My speculation is that if it's the formula for the text propert of a label, you need to add .ID after the filter expression to specify what value to display in the table.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit(Haman)
Highlighted
Regular Visitor

Re: Searching/Filteringon multiple conditions

@PowerAddict 

you are correct. I originally had the formula in the items property of a dropdown and also put it in a label as well to see what happened. 

in the lable text property the formula is as follows now:

Filter(TotalCasignTable, OD = Value(CasignOD.Text), Weight = Value(CasignWeight.Text), Grade = CsgGrade.Text).ID

 

attached is what i see for the items property formula in the dropdown cell.

Highlighted
Super User
Super User

Re: Searching/Filteringon multiple conditions

Sorry I got injured yesterday. Will respond soon.
Highlighted
Super User
Super User

Re: Searching/Filteringon multiple conditions

Just to refresh, the value is working in a label now but not in a dropdown? In the last image you attached, is that the Items property of the dropdown? 

 

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit(Haman)

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

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,613)