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

How to filter and show two sharepoint lists on one screen?

Hello all,

 

since I received such good help here earlier, I would like to ask you another question.

 

I have two Sharepoint lists that I want to show combined on one screen (after using a filter first).

 

My filter is a date picker: 

Greta1_0-1651224456133.png

I am filtering the first Gallery as follows and it works perfectly: 

 

Filter(Table_1,
(Created>= dteStartDate.SelectedDate
Or IsBlank(dteStartDate.SelectedDate)
)
And
(Created< DateAdd(dteEndDate.SelectedDate, 1, Days)
Or IsBlank(dteEndDate.SelectedDate)
)
)

 

Now I would like to have my second sharepoint list filtered in the same way and it is only supposed to show the "status of requests" in the orange button field (Under Items I have put here: ThisItem.Status.Value). I am filtering the second gallery in the same way like gallery one, just with the difference that I am using Table_2 as the data source).

 

The problem is, that it shows me ALL the status for each table row, instead of one status per row that is supposed to fit the items in Sharepoint List 1. So this is how the big gallery (Sharepoint List 1) and the small one (only the orange buttons, Sharepoint List 2) look like:

 

Greta1_1-1651225123612.png

With the orange Buttons (Status field from Sharepoint List 2) showing multiple times:

Greta1_3-1651225394136.png

 

How can I fit these two lists together, so that the right status for each row is shown?

 

I hope it is somehow clear what my issue is. 

 

Thank you so much in advance!


Greetings 

 

1 ACCEPTED SOLUTION

Accepted Solutions
BCBuizer
Super User
Super User

Hi @Greta1,

 

Try swapping the attributes:

 

NestedGallery.Items = Filter(Table_2, ID_unique = ThisItem.ID)

 

ThisItem.XYZ will refer to Table_1 as it is the data source for the parent gallery, hence it will not recognise ID_Unique.

 

Also make sure you have refreshed your connector for Table_2 in the PowerApps studio to have any changes, like a newly added column, reflected.

View solution in original post

6 REPLIES 6
BCBuizer
Super User
Super User

Hi @Greta1 ,

 

In any scenario when using a nested gallery, the Items property should include a filter that relates to ThisItem (of the parent gallery):

 

NestedGallery.Items = Filter(YourChildList, ParentID = ThisItem.ID)

 

In the above example the items in YourChildList (in your scenario Table_2) are filtered by their reference to the parent list (in your case Table_1): ParentID

 

Can you please share which column in Table_2 holds the reference to Table_1 and which column in Table_1 it refers to?

Greta1
Frequent Visitor

Hey BCBuizer,

 

thank you so much for your reply! Thats my problem, I don't have a ParentID that is the same for Table 1 and 2. Basically the entries from Table 1 are written into Table 2 automatically (through Power Automate), but they have different ID's. Do you know if there is any other way to link the lists? 

BCBuizer
Super User
Super User

Hi @Greta1 ,

 

Yes, by adding a column ParentID to Table_2 and have power automate populate that automatically as well.

Greta1
Frequent Visitor

Thank you so much! I did that now. So I have my column "ID" in Table_1 that is automatically copied to the corresponding column in Table_2 called "ID_unique"

 

I tried the code: 

 

NestedGallery.Items = Filter(Table_2, ID = ThisItem.ID_unique)

 

But it's not working, it doesn't recognise "ID_unique" and it is not showing me the orange Buttons with the Status value anymore. What am I doing wrong?  

BCBuizer
Super User
Super User

Hi @Greta1,

 

Try swapping the attributes:

 

NestedGallery.Items = Filter(Table_2, ID_unique = ThisItem.ID)

 

ThisItem.XYZ will refer to Table_1 as it is the data source for the parent gallery, hence it will not recognise ID_Unique.

 

Also make sure you have refreshed your connector for Table_2 in the PowerApps studio to have any changes, like a newly added column, reflected.

Greta1
Frequent Visitor

@BCBuizer it worked now, thank you very much! 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

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.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,419)