cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Donglin
Level: Powered On

Look up from another list

I have created 2 SharePoint lists PartItem and StockList.
PartItem has fields: Title, Description, Category.
StockList has fields: Title, Quantity, StockLocation.
To view the stock, I created the Gallery called Gallery1, and I created another gallery called Gallery2 with a button for filter, the Gallery2 item was assigned a table for the Category of PartItem list, [{Filter:"All"},{Filter:"Maintenance"},{Filter:"Consumable"}, {Filter:"Other"}] button of the Gallery2 OnSelect is Set(ItemFilter, ThisItem.Filter). And there is a SearchBox1 for input of searching text.
l would like to show the fields Title, Quantity, Description, Category, and StockLocation by the Gallery1, and the search content could be either Title and Description, and the filter needs to be applicable, would anybody please advice how to make up the codes for Items of Gallery1? Thanks a lot.
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Look up from another list

Hello @Donglin ,

 

If I understand correctly you have 2 SP Lists and want 1 Gallery to display all info about this.

The Title will be the same in both lists?

 

If this is the case you can do the following on the OnStart of your app:

ClearCollect(colFullList,AddColumns(PartItem List, "Quantity", LookUp(StockList,Title = Title).Quantity,"StockLocation", LookUp(StockList,Title = Title).StockLocation))

(A better way would be to only have 1 list in SP with all these fields together)

Now regarding your question on Filtering, Gallery1 Items Property:

Filter(Search(colFullList,txtinputControl.Text,"Title","Description"),Category.value = ItemFilter)

 

I am using Category.value because I assume that this is a choice field in SharePoint. If this a string field in SharePoint you can just have Category

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

3 REPLIES 3

Re: Look up from another list

Hello @Donglin ,

 

If I understand correctly you have 2 SP Lists and want 1 Gallery to display all info about this.

The Title will be the same in both lists?

 

If this is the case you can do the following on the OnStart of your app:

ClearCollect(colFullList,AddColumns(PartItem List, "Quantity", LookUp(StockList,Title = Title).Quantity,"StockLocation", LookUp(StockList,Title = Title).StockLocation))

(A better way would be to only have 1 list in SP with all these fields together)

Now regarding your question on Filtering, Gallery1 Items Property:

Filter(Search(colFullList,txtinputControl.Text,"Title","Description"),Category.value = ItemFilter)

 

I am using Category.value because I assume that this is a choice field in SharePoint. If this a string field in SharePoint you can just have Category

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Donglin
Level: Powered On

Re: Look up from another list

ClearCollect(colFullList,AddColumns(PartItem List, "Quantity", LookUp(StockList,Title = Title).Quantity,"StockLocation", LookUp(StockList,Title = Title).StockLocation))

Unfortunately it can't get the result, maybe it's delegation problem, I have about 1000 records in each of the lists.
Donglin
Level: Powered On

Re: Look up from another list

I found the reason,  must rename the Title to another name by using function RenameColumns first.  e. g.  Title1=Title in the codes. 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,162)