cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
corban6534
Frequent Visitor

Filter a list by another list

So I'm making an app to keep documentation for all our customers network setups in a sharepoint site and then creating a front end for in it powerapps. The problem I'm having is getting page 2 of the app (a list of sites) to be filtered by the choice made on page 1 (a list of companies) the two lists are in a sharepoint site and were made in access with a relationship between 2 fields in each list. Here's how it's setup:

tblCompanies has it's primary key linked to the field "Company" in tblSiteDetails.

I want to select a company from the gallery on screen1 of the app and then have it filter the gallery on screen 2, showing only the sites belonging to the company I just picked on screen1.

Is there a simple piece of code I can use to do this or would it be a complicated feature? Any help would be great.

Thanks,

Corban

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Anonymous

After some playing around I found that doing it that way wasn't so simple as it didn't take the data from the selected field on screen 1. The way I got round it was by having a hidden label that gets the company ID that I want and then have the gallery get it's data from there.

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @corban6534

 

This should be pretty simple to setup.

 

You can make use of this function:

Gallery1.Selected

Which will "know" which item is selected in first gallery and use it on the second screen

 

Second Screen Gallery.Item should be this:

Filter(tblSiteDetails, CompanyID = Gallery1.Selected.CompanyID)

Hi @Anonymous

After some playing around I found that doing it that way wasn't so simple as it didn't take the data from the selected field on screen 1. The way I got round it was by having a hidden label that gets the company ID that I want and then have the gallery get it's data from there.

 

View solution in original post

I got an error when use "=" which say error argument type. 

 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (48,683)