OQL is a way to retrieve persisted data from the database via the mendix object model. Remote entities are as the name suggests not persisted in your local database, so there you have your mismatch.
It seems you want to get the appnumbers from the remote entity for apps that are not in your “local” app.
I don't know how big the dataset of appnumbers is on both ends. But I see at least several options off course depending on the volumes.
(1) get a list of all apps from the remote app and persist them in a local entity. Then you can do your magic, with a normal xpath or with the OQL.
(2) get the list of all apps from the remote app, process them (not persisted) in a loop, removing each app from the list that you also have in your local app. I would Iterate through the list that has the smalles number of items and then remove them from the other list.
(3) a variant of nbr 1 but you update the apps from the remote entity upfront or periodically via e.g. a scheduled event
(4) expose a REST API, where a POST or a GET + Queryparameter accepts a list of Appnumbers and returns all apps that are not in that list.
Unless you have a very large amount of objects in these entities, I dont see why your original microflow based solution would require a lot of time…You can maybe speed up things by:
Hope this helps you.
Jacob