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

Filter distinct combobox

I have 10 comboboxes with distinct results. These comboboxes are filtering a gallery (think spreadsheet filter options). I have all 10 comboboxes working with their distinct syntax and the gallery is filtering correctly. Now I want to filter the comboboxes distinct to only show relevant information dependent on one or more of the other combobox. 

Such as combobox1 has 5 options that are unique names (action1, action2, action3, action4, action5). Combobox2 has (date1, date2, date3). Action1 and action3 both have date2. So if I filter combobox2 by date2, I should only see action1 and action3 in combobox1.

 

Has anyone ran into an issue like this and found a solution? Maybe I am over thinking this as I have been working on this PowerApps for 2 weeks and am not seeing the simple things..

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@techtudoor 

Definitely don't overcomplicate in PowerApps...Keep it Super Simple!

 

That said, I believe based on your description, that the information I provided in this thread posting might help solve your situation.  Take a look and see if that gives you what you are looking for.  Slightly different scenario, but similar in concept to how to do it.

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

15 REPLIES 15
satishkumark
Helper I
Helper I

Hi Team,

I am also working for the same scenario. I have a SP List which contains combination of single line of text columns and 10 Columns are choice type.

Now I want to filter combination of text fields and Choice type and display the data into a Gallery in there respective columns. 

I can able to filter combination of all columns except Tools Column. 

Filter formula Items property in Gallery.

If(
(IsBlank(DDSearchText.Text) && IsBlank(PNSearchText.Text) && IsBlank(AccountSearchText.Text) && IsBlank(ToolsComboBox.SelectedItems) && IsBlank(CategoryComboBox)),
CatMaster,
Filter(
CatMaster,
DDSearchText.Text in DD && AccountSearchText.Text in AccName && PNSearchText.Text in ProjectName && MethodSearchText.Text in Method && CategoryComboBox.Selected.ToolCategory in Category
)
)

PFA SP List  and Gallery screenshots.

Any help would be appreciated.

 

RandyHayes
Super User
Super User

@techtudoor 

Definitely don't overcomplicate in PowerApps...Keep it Super Simple!

 

That said, I believe based on your description, that the information I provided in this thread posting might help solve your situation.  Take a look and see if that gives you what you are looking for.  Slightly different scenario, but similar in concept to how to do it.

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!

@RandyHayes , this seems to make sense. I will give it a try and let you know how it goes.

 

Thank you

@satishkumark ,

In response to your PM

Filter(
   CatMaster,
   (IsBlank(DDSearchText.Text) || DDSearchText.Text in DD) &&
   (IsBlank(PNSearchText.Text) || PNSearchText.Text in ProjectName) &&
   (IsBlank(AccountSearchText.Text) || AccountSearchText.Text in AccName) && 
   (IsBlank(MethosSearchText.Text) || MethodSearchText.Text in Method)
   (Len(CategoryComboBox.Selected.ToolCategory)=0  || Category = CategoryComboBox.Selected.ToolCategory) 
)

@RandyHayes, this is working great Thank you very much!! I am however running in to 1 issue though, I have a date field as one of the comboboxes. This date field I want to display the date in the combobox only in the mm/yyyy format. This is working. The problem is that once I select a date from the combobox, the other Comboboxes do not display any options. Ideas?

Sort(
    Distinct(
        Filter(
            SPLIST,
            (IsBlank(varGalleryFilter.Title) || Title = varGalleryFilter.Title) && (IsBlank(varGalleryFilter.Column3) || Column3.Value = varGalleryFilter.Column3)
        ),
        Text(
            SubmittedDate,
            "[$-en-US]mm/yyyy"
        )
    ),
    Result
)

 

RandyHayes
Super User
Super User

@techtudoor 

So, this formula looks fine, but you are losing the real date of that column!  How will this impact the other dropdowns?  Are then dependent on a Date value or only on a "mm/yyyy" text string?

 

_____________________________________________________________________________________
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!

I am converting all dates on this screen to a string. Due to space limitations and ease of use, I am searching on mm/yyyy while the Date field in the gallery is a string with mm/dd/yyyy. I am still working on this as it will be a big option that the will be asked about.

RandyHayes
Super User
Super User

@techtudoor 
So the key is that you're going to have to compare text to text in exact format.  So if you are converting to mm/yyyy, then for all the other dates you will need to do the same and compare accordingly.   10/2020 does not compare to 10/13/2020 for example.

_____________________________________________________________________________________
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!

@RandyHayes, thank you so much!! This works. I still am working on getting the People field working, but that may be a syntax issue. I am using Left(peoplebox.Selected.Email, LEN(peoplebox.Selected.Email) -n {n is number of characters to remove domain from email}. 

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.

Top Solution Authors
Top Kudoed Authors
Users online (4,462)