Searching for a datatype inside another data type

I’ve a very big problem: I need to search all the Type 3’s element inside the Element B that has the same field of Element A… I don’t if I’ve explained well the problem… Could someone help me?

I don’t get it…

Element A doesn’t have any Data Type 3s… so I’m not sure what you’re tyring to do?

Can you give an example?

User A is searching for a software house
User B is connected with Company A, that is a Grocery and with Company B that is a software house
I want to collect in an email to send to User B, all the companies that is connected with User B and that is software house.