cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
cjnunn
Level: Powered On

Filtering a gallery by using a value in another list

Hello, everyone. 

 

I am brand new to PowerApps, and I am struggling with my first app.

 

The goal is essentially to have a personalized user home page with links to various "Favorites" that the user chooses from a list.

 

What I have done is created 2 SharePoint lists:

TestAppsList: holds a list of information about applications (App name, web link, icon, etc.)

UserApps: holds the information about a particular user's preference to have the app as a favorite. (User email, App name, preference(boolean), and a column to identify each record by app and user(concatenated user email and app name))

 

What I am trying to do is have 2 galleries.

 

Gallery1: Shows a list of all of the apps in the TestAppsList

Gallery2: Shows a list of all of the apps in the TestAppsList where the user has marked the app as a favorite (In UserApps: preference=true)

 

I am using a toggle in Gallery1 to set the prefence value in UserApps

 

I cannot get Gallery2 to only show the values that are "favorites".

 

I have tried many things that did not work, but the closest I got was:

(in the Items field for Gallery2)

Filter(TestAppList, TextInput1.Text in ShowColumns(Filter('UserApps', Favorite = 1), "UserApp").UserApp)

 

For some reason, this is still showing all of the apps in the list, instead of only the "favorited" ones

 

I also tried Filter(TestAppList, If(Toggle1.Value = true , StartsWith(Title, Title1.Text))), but this only shows the last item that was toggled.

 

Any help would be very much appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Filtering a gallery by using a value in another list

@cjnunn 

Can you explain a little more on Gallery2 - you state listing all of the apps in the TestAppsList.

Are you stating that only the apps that are marked as favorites should appear?

 

If so, your formula for the Items property should be the following:

Filter(TestAppList, AppName in Filter('UserApps', Favorite && UserEmail = User().Email).AppName)

In this formula we are filtering the favorite apps from the UserApps list where Favorite is true AND (&&) the Email in the list is equal to the current user email.  This filtered table is then used to "feed" the Filter on the TestAppList which will compare if AppName is in the inner filter.

 

I hope that is what you are looking for.  If not, post back and we'll expand from there.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Filtering a gallery by using a value in another list

@cjnunn 

Can you explain a little more on Gallery2 - you state listing all of the apps in the TestAppsList.

Are you stating that only the apps that are marked as favorites should appear?

 

If so, your formula for the Items property should be the following:

Filter(TestAppList, AppName in Filter('UserApps', Favorite && UserEmail = User().Email).AppName)

In this formula we are filtering the favorite apps from the UserApps list where Favorite is true AND (&&) the Email in the list is equal to the current user email.  This filtered table is then used to "feed" the Filter on the TestAppList which will compare if AppName is in the inner filter.

 

I hope that is what you are looking for.  If not, post back and we'll expand from there.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

cjnunn
Level: Powered On

Re: Filtering a gallery by using a value in another list

Hi, Randy.

 

Yes, Gallery2 should only show the apps that the user has marked as a favorite. Your formula did the trick. Thanks so much!

 

I think the problem was that I was approaching it from a database mindset. I was trying to use a concatenated field (User email and AppName) as a primary key to identify the record in the UserApps list. Then I created a hidden text box that held the concatenated value, and tried to use that to lookup the value in the UserApps list, instead of just using the user's email.

 

This is the working formula (slightly modified with actual column names):  

Filter(TestAppList, Title in Filter('UserApps', Favorite && User = User().Email).AppName)

 

Thanks again.

Super User
Super User

Re: Filtering a gallery by using a value in another list

@cjnunn 

Looks good!  Glad you were able to get it working.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,449)