This blog provides the background information on how to create a relationship between two ListView web parts in SharePoint and make the end users filter the values based on a keyword.
Before we begin, we require two lists to be created in SharePoint. Then, we need to make one list as the source and the other one as a target list. In my example, I have taken an employee details list. So, I have two lists here - the first one contains the names of the employees and the second one contains the information of each employee.
Note
This relationship method will work in the classic SharePoint site.
List 1 (Source List)
List 2 (Target List)
Now, open the target list (employee Information) view and edit the page. Then, using the "Add a Web Part" option, add the employee information list view web part over there.
Once you have added the source list and target list in a single page, you can see one extra option called Connection while editing the list view web part. This helps us to create a relationship between two list items.
So here, you can select connection -> Get filter value from -> employee name ( SharePoint will automatically recogonize the unique list column name and it will populate over there).
After selecting the column name, the small popup will get opened to select the filter column name from the source to target list. In this example, I have created Employee Name as a common column name.
Once you click "Finish", you can see one more icon in the Source ListView.
And finally, save the page and test the functionality. When you click any item, the target list will get a filter based on the value clicked by you.