I have a snippet of a flow I am working on below:
What I am trying to do is the following:
- An account record id is passed which then
- finds all partner accounts to it by getting the account relationship record that has the Partner_Account__c field = record id (account). There could be multiple account relationship records/partner records,
- which is why i have a loop.
- Then, I am getting the accountTo account info that is in each account relationship record.
- From there, in the accountTo account,
- i am finding the account owner and adding to the account team member related to the account record.
That is what the flow is doing. In other words, i want to add all account partner's owners as Account Team member in the original account.
As you can see from the flow, I have 2 get records and then am doing a dml operation inside the loop. I have done loops several times before, but for some reason in this scenario I dont know how to bulkify this.
How do I add all that user info (account owner) in a collection and update/create that one account team member record? In here i feel like it will create multiple account teams. Can someone please help me improve this flow based on my requirement? Thanks