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

Announcements

News and Announcements icon
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 2026 Season 1 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 2026 Season 1 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 997

#2
Valantis Profile Picture

Valantis 810

#3
Haque Profile Picture

Haque 642

Last 30 days Overall leaderboard