cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

Filter datatable based on ID from another sharepoint list

Hi,

I'm trying to populate a records from a dataTable which matches an ID from a different datasource. 

The Datatable has a datasource from a sharepoint list (sharepoint2) which is linked to datasource from another sharepoint list (Sharepoint1). So if Sharepoint1 ID is 332 I would like to filter Datatable to only show items from ID 332.

Sharepoint2 is set up to populate records from the ID from Sharepoint1.

 
 
2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User
Super User

Re: Filter datatable based on ID from another sharepoint list

I am going to try to give you a sample formula without knowing your exact column names. Also, how are you capturing the input from the user for Sharepoint1 ID? I am going to assume that its in a textbox. Let me know if its different. 

 

The datatable Items property should be something like this: 

 

Filter(Sharepoint2, ID = textbox1.text)

 

OR if you want to populate all items for Sharepoint2 where the ID is a value in Sharepoint1, then:

 

Filter(Sharepoint2, ID in Sharepoint1.ID)

 

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit(Haman)

View solution in original post

Highlighted
Helper III
Helper III

Re: Filter datatable based on ID from another sharepoint list

Hi @PowerAddict ,

 

It worked :). I had to use the datacard value in the Source:

Filter(Comments_WBS, wbsID in DataCardValue156_1.Text)

 

DatacardValue156_1 holds the ID value from Sharepoint1 

 

Thanks 🙂

 

Regards,

Trond

View solution in original post

7 REPLIES 7
Highlighted
Super User
Super User

Re: Filter datatable based on ID from another sharepoint list

I am going to try to give you a sample formula without knowing your exact column names. Also, how are you capturing the input from the user for Sharepoint1 ID? I am going to assume that its in a textbox. Let me know if its different. 

 

The datatable Items property should be something like this: 

 

Filter(Sharepoint2, ID = textbox1.text)

 

OR if you want to populate all items for Sharepoint2 where the ID is a value in Sharepoint1, then:

 

Filter(Sharepoint2, ID in Sharepoint1.ID)

 

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit(Haman)

View solution in original post

Highlighted
Helper III
Helper III

Re: Filter datatable based on ID from another sharepoint list

Hi @PowerAddict ,

Unfortunately this shows all items from Sharepoint2. Sharepoint2 is set up (by flow) to capture the ID, Author, Comment Date and comment from Sharepoint1 when an item is added in Sharepoint1.

 

FilterID.jpg

Highlighted
Super User
Super User

Re: Filter datatable based on ID from another sharepoint list

Let me make sure I got it right:

1. You have data in Sharepoint1 that has unique IDs.

2. You also have data in Sharepoint2 that has the same IDs.

3. You want to show only those records from Sharepoint2 where the ID is the same as the ID of the Sharepoint1 record you are on

Is that correct? Then how is the user selecting a record from Sharepoint1?

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit(Haman)
Highlighted
Helper III
Helper III

Re: Filter datatable based on ID from another sharepoint list

You are right,

 

1. This is the main sharepoint that gets all data logged from the PowerApp.

2. Sharepoint 2 is set up to capture the ID, Author, Date, and comment. Once an item is registered to Sharepoint 1 a flow will run and feed these 4 fields from Sharepoint1 to Sharepoint2.

3. Correct.

 

Thanks @PowerAddict  for looking itno this :).

 

Regards,

Trond

Highlighted
Helper III
Helper III

Re: Filter datatable based on ID from another sharepoint list

So @PowerAddict there are 2 different data sources:

FilterID2.jpg

Highlighted
Helper III
Helper III

Re: Filter datatable based on ID from another sharepoint list

Sorry, it's the other way around... Top Data Source is Sharepoint1 and bottom (DataTable) is Sharepoint2

Highlighted
Helper III
Helper III

Re: Filter datatable based on ID from another sharepoint list

Hi @PowerAddict ,

 

It worked :). I had to use the datacard value in the Source:

Filter(Comments_WBS, wbsID in DataCardValue156_1.Text)

 

DatacardValue156_1 holds the ID value from Sharepoint1 

 

Thanks 🙂

 

Regards,

Trond

View solution in original post

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,639)