Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Dynamics 365 Update a Record crearint new Record

(0) ShareShare
ReportReport
Posted on by 18

Hi All,

 

I have 2 Flows.

 

1. On creation of a NEW contact (Dynamics 365), create NEW Project Online and create a NEW Lead with Topic (Project ID)

2. On PUBLISH of Project Online , UPDATE the lead with start and end dates of project (Record Identifier = Project ID)

 

Step 1:Flow 1 runs and does the intended

Step 2:When a project is published Flow 2 runs and creates a NEW lead (Although Lead from Flow 1 is already created with Project ID)

When the project is published again it UPDATES the lead created in step 2.

 

Problem:

It should not create a new Lead when Project is published for the first time rather it should upate the lead created in Flow1?

Although the Project ID is same in all the cases. Than why Update of D365 creates a new record and than it works fine with the new record created? Why doesnt it get the record created for the first time in Flow 1?

What am I doing wrong?

 

 

 

Flow1Flow1Flow2Flow2

 

  • GabrielStJohn Profile Picture
    on at
    Re: Dynamics 365 Update a Record crearint new Record

    Hello, @MNarmeen1!

     

    Have you had a chance to apply @v-xida-msft‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!

     

     

    Thank you for being an active member of the Flow Community!

     

    -Gabriel

    Flow Community Manager

  • Verified answer
    v-xida-msft Profile Picture
    on at
    Re: Dynamics 365 Update a Record crearint new Record

    Hi @MNarmeen1,

     

    I think there is something wrong with your second flow that you provided. The Record identifier field of the "Update a record" action is required to fill a unique identifier (Lead ID) of the record rather than the Project Id. If you want to update the Lead record that created by your First flow, you should find the corresponding Lead Id of the created Lead record firstly.

     

    More details about the "Update a record" action of Dynamics 365 connector, please check the following article:

    https://docs.microsoft.com/en-us/connectors/dynamicscrmonline/#update-a-record

     

    I have made a test on my side, please take a try with the following workaround:

    First Flow:9.JPG

    The flow works successfully as below:10.JPG

     

     

    Second flow:

    • Add a "When a project is published" trigger, specify Root Site URL.
    • Add a "List records" action, specify Organization Name, Entity Name set to Leads.
    • Add a "Filter array" action, From set to output of the "List records" action, within condition box, left input box set to Topic dynamic content of the "List records" action, right input box set to Project Id dynamic content of the trigger, middle drop down set to is equal to.
    • Add a "Apply to each" action, input parameter set to output of the "Filter array" action. Within "Apply to each" action, add a "Update a record" action, specify Organization Name, Entity Name set to Leads, Record identifier field set to following formula:
    item()?['leadid']

    Image reference:11.JPG

    The flow works successfully as below:12.JPG

     

     

    More details about using expression in flow actions, please check the following article:

    Use expression in flow actions

     

     

    Best regards,

    Kris

  • MNarmeen Profile Picture
    18 on at
    Re: Dynamics 365 Update a Record crearint new Record

    Anyone knows how can I assign ProjectID to LeadId?

    The problem is it cant find the leadid as the record identifier is not the project id and its lead id.

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1