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

Filtering Contacts based on current item

Hi, I've very new to PowerApps so apologize if I have not posted enough information to solve.

 

I've been struggling with this for a days now and can't seem to figuire out this seemingly simple filter.

 

I am displaying all Contacts in a Gallery within a Datacard.  I am trying to filter the Contacts for only the current rental unit (DataCardValue151)

 

Would appreciate your help.  Thanks!

 

Let me know if you need any more information.

 

Derek.

3 REPLIES 3
RandyHayes
Super User
Super User

@derek1 

Is there some corresponding column in your Contacts that would relate the contact to the unit?  You will need that - or an alternate list to store that information.

 

If you do - let's say you have a UnitNumber column in your Contacts list, then you can set the filter on your Gallery to something like this:

Filter(Contacts, UnitID = ThisItem.UnitID)

 

The above assumes two things: 1) You have a UnitID in the Contacts list and 2) That you have a UnitID in the underlying record that you are editing.  If anything differs from your scenario, then adjust accordingly.

 

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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
derek1
Frequent Visitor

My relationships are a little nested.  Maybe thats why I have been having so much difficulty.

 

Relationships are as follows:

 

Tables: Contacts <--> Leases    Entities: cr0e2_leases <--> cr0e2_leaseid

Tables: Leases <--> Rental Units    Entities: cr0e2_rentalunit <--> cr0e2_rentalunitid

 

Thanks for your help. 

RandyHayes
Super User
Super User

@derek1 

Yes, so then you will need to get the list of leases from the rental unit id and then the list of contacts based on the lease id.

Something along this line would get you going...

Filter(Contacts, leaseid in Filter(Leases, rentalunitid = ThisItem.UnitID).leaseid)

Of course, substitute the above names with those that match your names in the app.

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

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.

Top Solution Authors
Top Kudoed Authors
Users online (1,138)