cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pricey79
Helper IV
Helper IV

Different data sources filtering

Hello everyone, I was hoping someone could help me please

 

I have two galleries, both coming from SharePoint, but different SharePoint lists.

 

List A  and List B

List A is a list of equipment, and List B is a list of cost for that piece of equipment

 

Is there a way I could have a gallery that shows pieces of equipment that someone has purchased, with their costs next to it. 

So for example,  lets say someone has seven laptops that cost £600 each.

So, when that user is logged in , it would show laptops with a cost of £4,200

 

Thank you for any help at all

10 REPLIES 10
BCLS776
Super User
Super User

Yes, if you can share the column names from your two lists, we can help you write the code to relate them. In short, you will use Filter to narrow down the list to records for the current user and use Lookup to find the price from List B for the matching item in List A.

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

@BCLS776 Thank you so much for your reply

In List A the column is Title and in List B the column is called Cost

Is there one column in each list? If so, it may make more sense to put them into the same list if the items and cost are a 1:1 relationship. Otherwise, we need a way to determine which record in List A relates to a record in List B.

 

Also, how is your app determining which items the user has purchased?

 

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

@BCLS776 No, there are more than one column in each

 

I'm using this to get the individuals items

Filter('Data Source', Contact = User().FullName)

Good, it looks like you have a workable Filter statement to narrow your results to the current user. Is that Filter in the Items property of your gallery? If so, consider modifying a label with a Lookup to find the cost from the other list. It should look something like: Lookup('Data Source2', ItemName = ThisItem.Purchased, Cost)

Note that the column/table names above are ones I made up -- use the ones from your solution

 

 

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

@BCLS776 

Yes its in the Items section.

 

This is what I have using your code above:

LookUp(Costs , Title = Gallery_Myitems.Selected,Cost) and I get the error message :

Incompatible types for comparison . These types cant be compared, Text,Record

 

Thanks fro your help with this. Much appreciated 

OK, Title is normally a single line of text column, so the issue is probably with Gallery_Myitems.Selected

 

If that is coming from a normal dropdown, can you substitute Gallery_Myitems.Selected.Value and let us know if that works?

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

@BCLS776 

 

When I add .Value I get the error : Name isnt valid. Identifier not recognised

 

Sorry to be a pain!

 

I am assuming this is a dropdown, not a combobox, and it is outside of your gallery? If so, try this to see if you get a different behavior: Gallery_Myitems.SelectedText.Value

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,240)