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.

View solution in original post

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

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

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (17,275)