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 / Linking parent and chi...
Power Automate
Unanswered

Linking parent and child records automatically

(0) ShareShare
ReportReport
Posted on by 104

Hi all, 

I want to build a flow to link parent and child records of same entity. Here is the scenario, I have entity A. When a new record is created in entity A it will check for duplicate record using "List rows" connector, if record already exist then i want to add newly created record(child) to already existing record(parent). How can I do this?

 

I tried to use "relate rows" connector, but i am getting error as Action 'Relate_rows' failed.

 

Thanks.... 

Categories:
I have the same question (0)
  • Mira Ghaly Profile Picture
    11,415 Moderator on at

    @varshinims08 

    What is the relation between Parent and child is it 1:N?

     

  • varshinims08 Profile Picture
    104 on at

    @Mira_Ghaly

     

    Yes.. It is 1:N relationship. When I am creating records in entity it is linking correctly, But when testing in flow it is throwing error as

    9f3b6e72-e4b1-4002-8f73-84dbb42150c2.png

    Sometimes its working fine, sometimes showing error. I dont know what is wrong.

    Thank you... 

  • Mira Ghaly Profile Picture
    11,415 Moderator on at

    @varshinims08

    Can you please add a screenshot to the step where u create the child record and how you are setting the lookup? 

  • varshinims08 Profile Picture
    104 on at

    @Mira_Ghaly

     

    Here i am creating a child record,

    98244e0e-b168-4618-9c67-f684a3a6119a.png

    and this is my flow

    67ed9716-553a-40a5-9f9e-4062d0256247.png

    a48c6f22-b26c-4722-a4f3-6034d7bed670.png

    f4e97c7b-3df3-4a3b-8724-fc614c7659a8.png

    Thank you

  • Mira Ghaly Profile Picture
    11,415 Moderator on at

    @varshinims08 

    To set a lookup ok the child entity you do not need to use relate rows , Relate rows for N:N Relationships

     

    so while creating your child set the lookup to the parent as below:

    /parentshemanameinplural/ParentGUID

     

    To get your parent Schema Name, go to make.powerapps.com and go to tables -> Select your Table and Click Settings

    Mira_Ghaly_0-1613109730111.png

    Note: SchemName while passing lookup should be in Plural+ Lower Case

     

     

  • varshinims08 Profile Picture
    104 on at

    @Mira_Ghaly  Thank you

     

    I was able do it. But I want all the child records to have single parent.

    But in my case i set Top Count as 2, so 1st child will have 1st existing record as parent and all other childs will have child 1 as parent...

    If i set Top Count as 1, then no parent record will be atteched to the child..

     

    How to achieve this? 

  • Mira Ghaly Profile Picture
    11,415 Moderator on at

    @varshinims08

    Can you share screenshots of your flow so that I can understand the issue? 

  • varshinims08 Profile Picture
    104 on at

    @Mira_Ghaly

     

    Here is my flow 

    640ec560-a4b3-4a4e-b6a9-c93be284a50f.png

    5930a521-87b3-4678-98c1-97be107a9b3f.png

    85c85986-5000-4cb8-8ad9-38fef68f231a.png

    cb729743-341b-4afa-a5e4-3a71ada5e1d2.png

    The problem is if i choose Top count as 1 in List rows, the results of conditions in 'Apply to each' will be 'true'.....Even if all the values are correct  to get the false result.

     

    And I am trying to update the record from the 'when a row is created' trigger

    I have created a look up field called parent claim with N:1 relationship and trying to update that field with record from List row action.

    BUT i am getting NotFound error in Update action.

     

    If I use the delete action with Same GUID, it is working. But only Update action is not working.

     

    And if  I try to delete the record which i got from list rows, it is deleting the record successfully, 

    But if i try to delete the record from 'when a row is created' trigger, it is deleting but in showing error in Apply to each condition as ActionFailed. No dependent action succeeded. 

     

    Sorry for posting more than one thread here.

    I am new to Dynamics and I am not getting what is wrong with my flow. 

     

    Thank you... 

  • Mira Ghaly Profile Picture
    11,415 Moderator on at

    @varshinims08 

    Here you need to pass only the Id , which is the id from List Rows so Just pass GUID because this is the ID of the record and not a lookup

    Mira_Ghaly_0-1613340011346.png

     

  • Mira Ghaly Profile Picture
    11,415 Moderator on at

    @varshinims08 

     

    Have you managed to fix the above issue?

     

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 552

#2
Valantis Profile Picture

Valantis 388

#3
11manish Profile Picture

11manish 375

Last 30 days Overall leaderboard