I have a SharePoint List (List A) form built in PowerApps. The form was built using the SharePoint list form option from the list settings. I also have a SharePoint Library (List B) where documents related to specific List A items are stored. There may be many List B documents related to one List A item.
Both List A and List B have a field that contains a generated "MatterID" and the List A MatterID value is copied to the List B Matter ID when documents are loaded into the library. So I have a field that I need to compare in both List A and List B. I want to display the List B documents that are related to an item in List A inside the list A PowerApp form.
In days past, using InfoPath, this was very very easy to accomplish because the InfoPath form for List A displayed in a webpart and a ListB webpart could be added to the page and filtered by any field in the List A webpart (Get Filter Values from...). That is no longer possible thanks to the untimely death of InfoPath in my environment.
The field MatterID in List A is a calculated field so I move its value to another field called MatterIDStored where it is stored as text when record is created. So, the comparison is MatterIDStored to LMatterID (the library field).
I created a gallery in my List A form that uses List B as a source. I have tried multiple methods to make this comparison and pull in a filtered view of the library based on the MatterIDStored value in List A. Nothing works because the formulas require a "value" as opposed to a field reference to work. I tested this as shown below. In the photo clip, the blue area of form is List A. The light green area is a gallery view of List B. If I insert an actual value for the LMatterID ("2021-Dec-15-1069089:41:22") in the formula for the gallery then it displays properly as shown here. Basically I have "hard-wired" the result by setting the formula to: Filter('Exec Sec Library I', LMatterID = "2021-Dec-15-1069089:41:22").
If, however, I use a field "MatterIDStored" instead of the value in that field then the formula does not work. It returns errors because the reference to "MatterIDStored" is not valid in the Gallery. Note that I have tried doing the same with global variable but that also fails. How do make this work using a field instead of the value in that field? Something that was so simple to do with InfoPath and WebParts now seems impossible.
Thank you very much Alaa. This worked perfectly.
Hello,
Basically you have to reference the selected item of your gallery so your filter should look like
Filter('Exec Sec Library I', LMatterID = Gallery1.Selected.MatterIDStored)
Best regards,
Alaa
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1