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 / Assign owner of parent...
Power Automate
Answered

Assign owner of parent record to related record

(1) ShareShare
ReportReport
Posted on by 232

Hi all,

 

I have imported some data using dataflows but by using dataflows I've been unable to import the correct owner. They are all assigned to me. I have the data on a excel file.

 

How can i build a flow to grab the owner of the related record and apply that owner to the related record?

I tried to "List the child table, apply to each, list parent table, apply to each, update child table" but that took a lot time and was assigning the wrong owners to records.

Can someone show me how to make a manual trigger flow to do this please?

 

Thanks!

 

Categories:
I have the same question (0)
  • Verified answer
    RMCoder Profile Picture
    219 on at

    You can use the "List rows" Dataverse action to find your child records followed by Update a Row targeting the same child record with data from the expanded parent record.

     

    First, get your child records:

    RMCoder_2-1690996263671.png

     

    • I am limiting the columns returned with "Select columns" because the others aren't needed in my example.
    • I am filtering the results so that I only return rows that have a parent (the column value is not null)
    • Use the Expand Query option to get information about the related record. In my case, the lookup field on Accounts which points to a parent record is called parentaccountid. Again, I am choosing to only select the _ownerid_value column from that related table to reduce the data that comes through.

     

    Next, loop through the results and update the child with the parent's owner information:

    RMCoder_3-1690996463785.png

     

    • Click the "Show advanced options" link if you need to and find the Owner property you want to update. In my case, this is Owner (Owners).

    RMCoder_5-1690996623915.png

     

    • When passing in identifiers like this, you need to specify the entity/table name (in plural form) to tell the flow what that GUID refers to. In my case, the owner will always be a User (systemuser), so I surround the value with systemusers().
    • The expression I am using in that field is:
      items('Apply_to_each')?['parentaccountid/_ownerid_value']
      Where parentaccountid is the lookup column from my child record, and _ownerid_value is the unique identifier for the owner.

    There are a few considerations to make here, depending on your scenario:

    • If there's a chance your owner could be null (unlikely, but the logic applies to any lookup) you'll want to verify that beforehand or it will throw an error.
    • Something like this would suffice:
      if(empty(items('Apply_to_each')?['parentaccountid/_ownerid_value']),string(''),concat('systemusers(',items('Apply_to_each')?['parentaccountid/_ownerid_value'],')'))
      • Here we are checking if the _ownerid_value is empty. If it is, send an empty string, otherwise create the systemusers(GUID) string with a concat function.
    • If your owner column is polymorphic (for example, a lookup to Users or Contacts), you will need to check the entity type beforehand and make an adjustment in your concat function.
      items('Apply_to_each')?['parentaccountid/_ownerid_value@Microsoft.Dynamics.CRM.lookuplogicalname']
      • This will return the logicalname of the entity, such as systemuser.

    There's a lot to unpack there, but hopefully this gets you close to a full understanding. Please let me know if you need more explanation!

  • md7 Profile Picture
    232 on at

    Hi there, Thanks for such a detailed response. 

     

    It has worked for a lot of the rows but have had a few errors come back so will look into those. Thanks for your help!

     

  • md7 Profile Picture
    232 on at

    Hi again @RMCoder 

     

    I'm trying to do this for Notes (annotations) but I'm unsure what to put in my expand query as the look up field called "Regarding" is has the logical name of ObjectId but when i use that in the flow, I get the error

    Could not find a property named 'objectid' on type 'Microsoft.Dynamics.CRM.annotation'.

     

    Really confusing. 

    Do you know what i need to put instead? I assume i need to put a expand within an expand. 1 expand to open the accounts table, then another expand to open the systemuser table.

  • RMCoder Profile Picture
    219 on at

    The Regarding column is polymorphic, and so it can lookup multiple entities. You can pick the target by adding _sometablename to the end of objectid to specify a valid navigation property.

    Some examples:

    • objectid_account
    • objectid_email
    • objectid_contact

    The best way to see what targets are available for any given lookup is to view the column definition. One easy way to do so is from the Columns page of your table (e.g. Table > Note > Columns), click the ellipses next to the lookup column and select Advanced > Tools > API Link to Column Definition.

     

    This takes you to a JSON document that includes the Targets that the lookup can point to.

    RMCoder_0-1695156222136.png

     

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 607

#2
Valantis Profile Picture

Valantis 456

#3
11manish Profile Picture

11manish 352

Last 30 days Overall leaderboard