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
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.
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?
@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
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?
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
Learn how to create your own user groups today!
Check out the new Power Platform Community Connections gallery!
Congratulations, the new Super User Season 2 for 2021 has started!
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.