Hi Miya Qian
i think can you refer this its help you to solve this problem:
https://community.mendix.com/link/space/app-development/questions/134079
Your current error is coming from the fact that objects File1 and File2 are not comparable with each other. They are simply different objects types.
What you *are* comparing is the text in those objects rather than objects. You might have to implement "intersect" functionality manually. That is loop through one list and find objects containing text in the other list; and the reverse the process.