Sunday, April 8, 2018

D365 Web API Batch Request, Transaction Integrity, and Logic Apps – Part 2

In my last blog, we looked at achieving transaction integrity using changesets with the batch request. The only problem with the batch request is that you can’t use the record created in initial requests in the subsequent requests. E.g., to create an order, we create an order record first then create all the line items related to the order. In a batch request, you can create the order record but can’t link that record to the order line items.

There are a few options to overcome this issue. This blog is discussing two of those options.For this blog, I am using the logic app created in the last blog ( This blog creates a contact record with two address records.

Option 1(Create the Contact record GUID Manually)

The one option is to generate a GUID before invoking the batch request and use this GUID  to create the contact record and related address records.

The following screenshots depict the changes in the logic app.
  • The first screenshot displays all the steps for the logic app.
  • The second screenshot displays the step to generate a new GUID for the contact. This step is using Initialize Variable action.
  • The third screenshot shows the part of the batch request. The screenshot also highlights where the GUID is used to create a new contact and related address records.


The creation of a manual GUID is not recommended for performance reasons. If the number of users and transaction volume can handle the performance hit, only then use this option. Otherwise, consider the second option.

Option 2 (Deep Insert)

The second option is not to use the batch request. The transaction integrity can be achieved using the deep insert.

This option allows us to create a new record and its related records in one operation. If the creation of any of the records fails, the system fails the whole operation.

The following screenshot displays the deep insert web API call.


Update Considerations

The above two options are useful for creating new records. If you want to update multiple child records based on a parent record, then consider making two API calls:
  • The first call to retrieve the GUID of the parent record based on available attribute/attributes (e.g., first name, last name, email, and address)
  • The second call (batch request)  to update the child records based on the GUID retrieved in the first call.

Download Links

You can download the logic apps created for this blog from the following links:

That is it. If you have a better solution, please share it.


  1. Thanks for posting the information I liked it
    Sanjary Kids is one of the best play school and preschool in Hyderabad,India. Give your child the best preschool experience by choosing the best playschool of Hyderabad in Abids. we provide programs like Play group,Nursery,Junior KG,Senior KG,and provides Teacher Training Program.
    ­play school in hyderabad

  2. If you don't want to create the Guid, or can't do a deep insert for some reason (like during associate requests), you can use the "Alternate Key" feature in Dynamics 365, ( and use them instead of the Guid.

  3. Excellent blog information I loved it

    Sanjary Academy is the best Piping Design institute in Hyderabad, Telangana. It is the best Piping design Course in India and we have offer professional Engineering Courses like Piping design Course, QA/QC Course, document controller course, Pressure Vessel Design Course, Welding Inspector Course, Quality Management Course and Safety Officer Course.
    Piping Design Course
    Piping Design Course in Hyderabad ­
    Piping Design Course in India­

  4. Great blog explained clearly about the topic

    Sanjary Academy provide pressure vessel design, quality management system course piping design course, qa/qc course and document controller course.
    Welding Inspector Course
    Safety officer course
    Quality Management Course
    Quality Management Course in India

  5. great Article
    Yaaron Studios is one of the rapidly growing editing studios in Hyderabad. We are the best Video Editing services in Hyderabad. We provides best graphic works like logo reveals, corporate presentation Etc. And also we gives the best Outdoor/Indoor shoots and Ad Making services.
    Best video editing services in Hyderabad,ameerpet
    Best Graphic Designing services in Hyderabad,ameerpet­
    Best Ad Making services in Hyderabad,ameerpet­


  6. Nice blog..! I really loved reading through this article. Thanks for sharing such a amazing post with us and keep blogging...
    Real Estate CRM

  7. I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking the time to discuss this azure training , I feel happy about it and I love learning more about this topic.

  8. Get valuable information about the web hosting service and top technical support. I got great information for the VPS Server Hosting.
    Germany VPS Server Hosting

  9. Wonderful system security and database restoring solutions!!!!! that is supper technical helps blog posting. I like this article too much. Thanks for sharing!!!!
    Linux VPS Server Hosting

  10. Mindblowing, This is an amazing superb article Keep Sharing this...
    Thanks a lot!!!!

    Germany VPS Hosting

  11. Great post full of useful tips! My site is fairly new and I am also having a hard time getting my readers to leave comments. Analytics shows they are coming to the site but I have a feeling “nobody wants to be first”
    python training in bangalore

    python training in hyderabad

    python online training

    python training

    python flask training

    python flask online training

    python training in coimbatore

  12. I read this article. I think You put a lot of effort to create this article. I appreciate your work. Gaming Jackets

  13. The great website and information shared are also very appreciable.
    rocketeer jacket

  14. Are you in need of a Loan/Funding for a project? Have you been trying to obtain a Loan from any of the Banks or Loan Companies and got Ripped off and they have refused to grant you the Loan because of bad credit? we offer all types of non-recourse Loan and funding at a low Interest Rate of 3% both long term and short term.

    The categories of Loan/financial funding offered include but not limited to: Business Loan, Personal Loan, Company Loan, Mortgage Loan, debt consolidation and financial funding for both turnkey and mega projects E.T.C. from a minimum of Euro / US$1Million to Euro / US$5Billion Max.

    Kindly get in touch for further details and procedure
    Whats-App no +919667837169
    Dr. Mark Thomas

  15. This site helps to clear your all query. mgsu bsc 3rd year result 2021
    Hpu ba 3rd Year Result 2021 This is really worth reading. nice informative article.

  16. Türkiye'nin en iyi torrent oyun indirme sitesine davetlisiniz.
    full oyun indir

  17. very nice post, i definitely enjoy this fabulous website, web design

  18. Great blog, Thanks for sharing this information. Our Astrologer Pandit Yoginath is one of theFamous Astrologer in Bangalore and provides the best astrology services, for more info visit our official website. Horoscope Reading in Bangalore | Black Magic Expert in Karnataka | Get Love Back in India

  19. Great piece of information.Thanks for sharing it!Get the best business loan funding you need in as little as 24 hours so you can get back to running your business. Contact Funding Center now to take our expert’s advice to choose the best option.

  20. Hi there I am so delighted I found your weblog, I really found you by accident,
    while I was researching on Bing for something else, Regardless I am here now and would just QUALITY UNDETECTED ORIGINAL FAKE DRIVING LICENCE like to say thank you for a fantastic post and a all round entertaining blog (I also love the theme/design), I don’t have time to go through it all at the minute but I have bookmarked it and also added your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the excellent job.

  21. I must say that you are my favourite author. You always bring surprised things for me everytime I see your articles. Great efforts!! Drive Scorpion Jacket

  22. Awesome article, it was exceptionally helpful! I simply began in this and I'm becoming more acquainted with it better! Cheers, keep doing awesome!

    B.C.A. Time Table 2022 - BCA 1st 2nd 3rd Ka Exam Routine
    Cusat University Time Table 2022
    Datta Meghe University Time Table 2022
    JRRSU Exam Time Table 2022

  23. wordpress web design company in united states Need professional WordPress Web Design Services? We're experts in developing attractive mobile-friendly WordPress websites for businesses. Contact us today!

  24. hotspot shield cracked for pc provides its users with better security for private data, online shopping, and internet privacy. Hotspot Shield License Key

  25. I must say that your article is out standing.most of the articles I come across these days do not really provide valid details that attracts others as yours, but believe me the way you interact is literally awesome  I do respect that so much. I will instantly get your rss and stay informed of any updates you make and as well take the advantage to share some vital information about. IMPORTANCE OF DRY SEAHORSE to human health and how to et them

  26. Get the complete information about Philippines Import Export trade Data by Philippines Eximp for USA, Russia, United Kingdom, France and more countries.
    Philippines Import Data

  27. In addition to information and games, a traditional Indian games website can offer resources such as videos, tutorials, and blogs &Top online Games in India .These resources can help visitors learn the rules and strategies of the games, as well as provide tips for playing and winning.

  28. Amazing Blog. Visit AAR Fragrance for Perfumes for Men Online at Best Prices in India, Buy Perfumes for Women Online in India, Davidoff Cool Water For Men EDT 125ml, and Versace Pour Homme Dylan Blue EDT 100ml.
    Perfumes for Men Online at Best Prices in India