We have external system that is pushing an event using Platform events saying that an asset is changed. I have created a Platform event object and a trigger on it, make a webservice callout to get the changed asset information and need to perform an upsert (We have a unique key on Asset object). However, I realized that platform event objects do not support external ids.
How do I perform an upsert without an external id? I can query the asset object and if the list size is greater than zero, update the asset record and if the list size is 0, I can insert a new asset.
Is there a better way of doing this?