Personalized Community is here!
Quickly customize your community to find the content you seek.
Have questions on moving to the cloud? Visit the Dynamics 365 Migration Community today! Microsoft’s extensive network of Dynamics AX and Dynamics CRM experts can help.
2023 Release Wave 1Check out the latest updates and new features of Dynamics 365 released from April 2023 through September 2023
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | All TechTalks
Hello I am trying to create a workflow that first:
1. Extracts data from CosmosDB, using a query
2. Looping over the results
3. Pushing the results data into CRM
Once this data is created in CRM, CRM automatically generates an ID for each record. How can I then:
4. Return the newly generated ID back to the original CosmosDB container in which it was pulled from?
I have started on this and these are my questions:
Does this first part look correct in what I am doing? I must use this SQL query for this:
a. I am simply telling the Logic App to extract data from a particular container inside CosmosDB
b. Then I would like to loop over the results I just obtained, and push this to CRM
c. My dilemma is: Once data is pushed to CRM, CRM then automatically generates an ID for each record that is uploaded. How would I then return the updated ID to cosmos? I am not sure how to construct this in LogicApps and have been researching examples of this.
Any help is greatly appreciated.
Regarding the Record Creation in Dynamics CRM and take the ID from it you can use the CDS Create Record action.
This action after creating a Record returns the ID from it through 3 differentes means:
- ItemInternalId: "<guid>";
- @odata.id : "https://<orgname>.crm<region>.dynamics.com/api/data/v9.1/<entity>(<guid>);
- Entity Primary Key (e.g. for Account it would be AccountId)
You can then extract one of these values, ideally the first option, through Dynamic Content and insert it in Cosmos.
As an example I've created an Account and extracted the ItemInternalId through the expression body('<actionname>')['iteminternalid']:
In this case I'm using compose but you could directly use the expression in the Cosmos DB action.
Hope this helps!
Thank you Felipe, I am reading the documents that you sent. Very helpful!
Business Applications communities