How to find a data type of one kind inside parent of another data type?

Hi all, sorry for the crude image. I have two things, one is Primary, and the other is Archive.

Within a popup of the type Primary, I am showing dynamic information from Primary. (Name, phone number, etc.)

I also have a repeating group where I want to show Archive entries where first name matches. (So as to show all past visits of a person to a location in the popup for their CURRENT visit to the location.)

I don’t understand the context of the search query I need to run for the Archive repeating group.