You can use a Helper entity around the two datagrids, with a search attribute.
By using a microflow to handle the search logic and displaying results in your data grids, you avoid the need to directly set attributes for search criteria and instead manage it through a centralized search function.