cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
krs10s6
Advocate I
Advocate I

Creating an FAQ - Filter Screens Based on Categories

Hi everyone, 

 

I am new to the PowerApps world - so far I am loving it but am looking to add some complexity into the app I am building. I am creating an FAQ app to use for a project. I've created a SharePoint List with fields for Questions, Answers, and Categories. I would like to create different "views" based off of the category that is selected from a drop down list (four choices: Customer Service, Account Service, General and Website). I've created four screens that correlate to the categories (similar to what I think of SharePoint Views).

 

When thinking similar to an If/Then statement, I am thinking along the lines of "If Category equals Customer Service, then View all Customer Service questions on the Customer Service Screen."

 

Is there code out there that would let me do this? I've done a bit of research and am having no luck finding something close to what I am looking to do. 

 

Thank you all in advance for your assistance! This PowerApps newbie really appreciates it! 🙂 

1 ACCEPTED SOLUTION

Accepted Solutions
Meneghino
Community Champion
Community Champion

Ok, then the drop down control should have the Items property set as follows:

["Customer Service",  "Account Service", "General", "Website"]

And the gallery should have the Items property set as follows:

Filter(MyFAQlist, Category.Value = Dropdown1.Selected.Value)

where MyFAQlist is the name of your SP list of FAQ

View solution in original post

8 REPLIES 8
Meneghino
Community Champion
Community Champion

Hi @krs10s6

 

It is difficult at first but you need to change a bit the way you think when dealing with PowerApps.

 

What you are trying to do can be achieved with a single screen.  This screen would contain just a dropdown to select the category and a gallery to display the results.  By using a Filter function in the Items property of the gallery, the displayed results will refresh automatically when the dropdown selection is changed, without the need for code to run.

 

The specific solution depends on the type of column of Category in your FAQ list.  Is it text, choice or lookup?

Hi @Meneghino,

 

Thank you so much for your insight.

 

The "Category" column type is a choice.

 

Thank you so much for your help! 🙂

Meneghino
Community Champion
Community Champion

Ok, then the drop down control should have the Items property set as follows:

["Customer Service",  "Account Service", "General", "Website"]

And the gallery should have the Items property set as follows:

Filter(MyFAQlist, Category.Value = Dropdown1.Selected.Value)

where MyFAQlist is the name of your SP list of FAQ

View solution in original post

@Meneghino it worked!!! 😄

 

Thank you so much for your help! I am so happy!

 

Have a great weekend!

Meneghino
Community Champion
Community Champion

You are welcome

Hi @Meneghino

 

I have a follow up question for you. The solution above works great and I am really excited about it but I wanted to see if the following is possible. 

For our Q&A page, my team would like to add a second category to search from - since questions can apply to two different categories and my understanding is that PowerApps will not recognize multiple selections from one column list. For example, many of my questions are related to Customer Service as well as Account Services. I want to be able ensure that these questions come up when either are selected in the drop down that is created. 

 

I tried to add a second filter into my gallery items but am having trouble getting it to work. My categories are the same in both columns. 

 

Thank you so much again for your help! 🙂 

Meneghino
Community Champion
Community Champion

OK, there a number of ways you can do that.

Here is an idea, create a list box instead of the drop down control.

Then do this:

 

ListBox1.Items = ["Customer Service",  "Account Service", "General", "Website"]

Gallery1.Items = Filter(MyFAQlist, Category.Value in ListBox1.SelectedItems.Value)

Where the left hand side of each equation shows you the property to set.

 

Please let me know how you get on.

Hi @Meneghino

 

I did try the list box suggestion and while I understand it, I am not sure it fits what I am looking to do since not all questions fall into both categories.

 

In browsing the PowerApps ideas forum, I did see that it is planned for PowerApps to start recognizing multiple selection columns from SharePoint as a solution soon. In the meantime, my fix is that I have a second category field (titled category 2) that is designated for specifically for my Account Services category and have adjusted my code accodingly:

Filter('Frequently Asked Questions: CSC', Category_x0020_2.Value = Dropdown2.Selected.Value)

While not ideal, it is a good temporary fix until PowerApps recognizes multiple selections. 

 

I did manage to accidentally delete my search functionality for searching text in my gallery and am having difficulties adding it back in with the filter function in place for flitering categories. Any suggestions? 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,357)