Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Logic App to push data from Cosmosdb into CRM and perform an update

Posted on by 75

I have created a logic app with the goal of pulling data from a container within cosmosdb (with a query), looping over the results and then pushing this data into CRM (or Common Data Service). When the data is pushed to CRM, an ID will be generated. I wish to then update cosmosdb with this new ID. Here is what I have so far:

pastedimage1595635042445v1.png
This next step is querying for the data within our cosmosdb database and selecting all IDS with a length that is greater than 15. (This tells us that the ID is not yet within the CRM database)

pastedimage1595635070910v2.png

Then we loop over the results and push this into CRM (Dynamics365 or the Common Data Service)


pastedimage1595635091723v3.png

Dilemma: The first part of this process appears to be correct, however, I want to make sure that I am on the right track with this. Furthermore, once the data is successfully pushed to CRM, CRM automatically generates an ID for each record. How would I then update cosmosDB with the newly generated IDs?

pastedimage1595635111830v4.png

Any suggestion is appreciated
Thanks


[1]: i.stack.imgur.com/l4klW.png
[2]: i.stack.imgur.com/D3wqI.png
[3]: i.stack.imgur.com/jIRnk.png
[4]: i.stack.imgur.com/NFGOP.png

  •  Lynnette2020 Profile Picture
    Lynnette2020 45 on at
    RE: Logic App to push data from Cosmosdb into CRM and perform an update

    Thank you Bipin,

    once this data is pushed into CRM, CRM automatically generates an ID for each record. How can I then:

    Return and replace the original ID that lives in CosmosDB with the the newly generated ID that CRM created?

    Should my next step be to create a variable that holds an array with the old IDs and then check for these old IDs and then replace with the new? If so, could you enlighten me on how to construct this within the LogicApp?

    Thank you for all your help

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Logic App to push data from Cosmosdb into CRM and perform an update

    Hi,

    So you are using Common Data Service Connector to push data to CRM Dynamics from logic app?

    If so, once you create record in CRM using Create a new record action from CDS. Data from this steps will be available in next subsequent steps to select fields from Create a new record action.

    If found helpful, Please mark my answer verified.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans