How to build a single HTTP request from data within a collection in Microsoft Flow

A challenge in Microsoft Flow is to obtain specific data from a collection of objects (Like Dynamics 365 records) and use some data from those records within a single¬†HTTP request. Why not make multiple HTTP requests within the ‘Apply Each’ loop I hear you ask? Well my friend, because there could be 100 records or more, that’s 100 hits to an endpoint which is really unnecessary, time-consuming and prone to error. Best Practice is, if the scenario allows it, to send as few requests as possible.

Iterate over child entities in Dynamics 365 using Microsoft Flow

One of the weaknesses of traditional workflows within Dynamics 365 is their inability to natively iterate over child records. Great news! Microsoft Flow allows you to be able to iterate over child records and pass in query string parameters allowing you to limit the returned collection. It achieves this using OData syntax. Trust me though, even if you have never used OData syntax before, with a bit of trial and error you’ll pick it up in no time. Check out this post for a very quick start to iterating over child entities using Microsoft Flow.