I have a requirement where I need to track multiple owners for a specific record. I built a custom entity (Account/Contact Business Owner) which can track multiple owners of an Account or Contact. I built a Power Automate flow that triggers upon the "Add" or "Modify" action of the Owner field and the flow will create the Business Owner record to automatically track the user who is the new owner.
The PA flow now needs to be modified so that when an Account or Contact Owner is modified, the existing Business Owner entity record that tracks the old owner is updated to reflect the new owner.
So if John created the Contact record, he would be listed as the Owner of the Contact and the PA flow would run and create a Contact Business Owner record with John as the Owner. But if that Contact is assigned to Jane, the PA flow would need to run and grab John's Owner record as the previous Owner and then use that guid/value to search for John's Contact Business Owner record and edit that existing Contact Business Owner record and replace John with Jane (new Owner).
I am not sure how to grab the previous Owner since the flow runs on the modification of the Owner field so it only sees the new Owner value. If I am able to grab that previous Owner guid and store it, then I can use that variable to then search for the existing Contact Business Owner record and then replace the Owner value on that record with the new Owner (Jane).
Any assistance would be greatly appreciated!