cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
MNarmeen1
Level: Powered On

Dynamics 365 Update a Record crearint new Record

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?

 

 

 

P1.PNGFlow1P2.PNGFlow2

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

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

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
MNarmeen1
Level: Powered On

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.

Community Support Team
Community Support Team

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

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Administrator
Administrator

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

-Gabriel
Microsoft Power Automate Community Manager

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 269 members 5,359 guests
Please welcome our newest community members: