cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Filtering sharepoint list based on the ID value of another sharepoint list

I have two sharepoint lists that I am connected to in my project. I want a Data table that only shows entries where the ID in my current table, is equal to the Last('Sharepoint List1').ID. I'll give an example of the formula I'm trying to get to work. 

 

Filter('Sharepoint List2', 'Sharepoint List2'.ID1 = Last('Sharepoint List1').ID)

This doesn't work, and tells me that the "=" is an "invalid argument type"

I'm placing this formula in the OnVisible for the page where the Data table is located.

 

Also I think it's worth mentioning that the ID value in "Sharepoint List1" is the automatically generated hidden ID value that sharepoint lists make, while the ID1 value in "Sharepoint List2" is one that I've made to reference the hidden ID from the other list. 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @Anonymous ,

Do you wan to filter 'Sharepoint List2' according the ID column in 'Sharepoint List1'?

Firstly, you could try this formula:

Filter('Sharepoint List2',ID1 = Last('Sharepoint List1').ID)

'Sharepoint List2'.ID1 is a table,it can’t be used to compare with a value.

Secondly, you should set the DataTable’s Items property instead of the screen’s OnVisible.

test419.jpg

 

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi,

 

With what I read in your post, you just put the formula in the OnVisible statement of your page.

The problem is that the function will give you a result with the type Table... I don't understand your function then!

 

You have to put your filter in the Items statement of a Gallery. Do it and tell me if you still have the problem  

 

Regards,

 

Louis

v-yutliu-msft
Community Support
Community Support

Hi @Anonymous ,

Do you wan to filter 'Sharepoint List2' according the ID column in 'Sharepoint List1'?

Firstly, you could try this formula:

Filter('Sharepoint List2',ID1 = Last('Sharepoint List1').ID)

'Sharepoint List2'.ID1 is a table,it can’t be used to compare with a value.

Secondly, you should set the DataTable’s Items property instead of the screen’s OnVisible.

test419.jpg

 

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,193)