web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Change the owner of th...
Power Automate
Unanswered

Change the owner of the opportunity from a team to the point of contact of that team

(2) ShareShare
ReportReport
Posted on by 8
I'm building a power automate flow to automatically assign the opportunity record to the Point of Contact (User) of a team. Currently, there are multiple opportunities which are owned by Teams. I need to change the owner of opportunity records to the point of contact of that particular team.
 
This is the flow I'm trying to build.
 
 
 
 
This is the error I'm getting.
 
 
 
Let me know what changes are to be made here.
 
 
Categories:
I have the same question (0)
  • bscarlavai33 Profile Picture
    752 Super User 2025 Season 2 on at
    You are querying for all Teams (which it looks like there is 5 of them) and then you're looping through all 5 Teams and then for each Team, you're looping through 262 Opportunities. So essentially you're trying to set the Owner on all 262 Opportunities, 5 times.
     
    The error is because the bmc_pointofcontact on one of the Teams is null and so its trying to set the Opportunity ownerid to null which isn't possible.
     
    I'm guessing there is one specific Team you want to use? You would want to set the Filter rows on this "List rows 2" so that it can filter to the one Team you're wanting to use.
     
  • PC-29072047-0 Profile Picture
    8 on at

    I'm trying to retrieve opportunities based on a FetchXML query. The condition is to retrieve opportunities whose owner is a "TEAM" and update the owner of those opportunities from the "TEAM" to the Point of Contact ("USER") of that team. The Point of Contact is a custom field (lookup) on the team record.

    Please provide a screenshot of the flow if you're able to build it to achieve this functionality.

  • bscarlavai33 Profile Picture
    752 Super User 2025 Season 2 on at
    I gotcha. In that case I would follow these steps:
     
    1. Use "List Rows" to query Opportunities using your Fetch XML
    2. Use "Apply to each" to loop through all the returned opportunities
    3. Inside the "Apply to each" use a "Get a row by ID" against the Teams table and pass in the Opportunity's ownerid as the ID
    4. Update the Opportunity's ownerid to the retrieved Team's bmc_pointofcontact field
    Some notes:
    • When you set the ownerid field on the Opportunity you need to do "systemusers()" and put the value from the bmc_pointofcontact field inside the () of systemusers so it would look something like "systemusers(41cbaf86-3164-490b-a5d7-be9645559ddd)"
    • If bmc_pointofcontact is null on the team, you will get an error when trying to update the Opportunity so before you call Update on the Opportunity, you could do a Condition to first check that the retrieved Team's bmc_pointofcontact is not null

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard