cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

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?

 

 

 

Flow1Flow1Flow2Flow2

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

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
Highlighted
Advocate I
Advocate I

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.

Highlighted
Community Support
Community Support

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

Highlighted
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
Are YOU a member of your local Power Automate User Group?
Fill out This Form to claim your Community User Group Member Badge!

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Users online (9,549)