Repeating Actions in LogicApps

Damir Dobric Posts

Next talks:

 

    

Follow me on Twitter: #ddobric



 

 

Archives

When working with LoicApps, your connectors will most likely sometimes return batch of messages (list of data), which needs to be processed by the next connector.

Most samples which are currently available shows how to process output of predecessor connector as a single item. This article describes how to implement repeating feature by using of LogicApps designer.
Unfortunately when working with repeating not everything is always clear and it is very dependent on how your data looks like. In this short post I described how to do that in more detail.

Following picture shows a simple LogicApp which uses DeviceConnector to get telemetry data. That means every time when connector triggers, the list of telemetry data is returned and needs to be processed by
HTTP connector. The task of HTTP connector is to send every single telemetry message to some HTTP endpoint. Following picture shows how I configured HTTP-action by following the post named above.

image

To understand how to configure repeating, let’s first take a look on the data which is returned by DeviceConnector.

image

As you see connector trigger will return an object which has a property ‘Data’, which is a collection of telemetry data. Out goal is the setup repeating over telemetry data. That means for each telemetry in Data, we want to send one HTTP request.

This is how the HTTP connector has to be configured.

image

With repeat, I will basically select every item from collection @triggers().outputs.body.Data.
Body attribute @repeatItem() specifies a single item from collection which will be posted to HTTP endpoint.
And this is how connector looks like now in designer.

image

This is how the input of HTTP-action looks like:

image

This is how the output of HTTP-action the trigger looks like:

image


Posted Jun 13 2015, 10:40 AM by Damir Dobric
developers.de is a .Net Community Blog powered by daenet GmbH.