Raymondo
Raymondo

Reputation: 587

Logic Apps For Each

I am try to utilise the For Each object in logic apps and I am not sure if this is possible:

Step 1 - SQL Stored Procedure is executed returning a number of rows

Step 2 - For Each based on the number of rows in Step 1

Step 2a - Execute a SQL Procedure based on values in loop

The problem I am finding is that when I add the loop, it states that there is no dynamic content available even though Step 1 will return results.

I've googled and there seems to be no information on using the for each loop in Logic Apps.

Any suggestions?

Thanks

Upvotes: 0

Views: 2126

Answers (2)

Henk
Henk

Reputation: 1

unfortunately its by design: https://learn.microsoft.com/en-us/azure/automation/automation-runbook-types#powershell-runbooks

I resolved it by calling the SP's in parallel via Logic Apps. (note: when you do so, don't forget to hit 'Publish' runbook in order for the input variables passed to be picked up correctly)

Upvotes: 0

Derek Li
Derek Li

Reputation: 3111

We're working on a fix for this. Before the fix is available, try one of these two workarounds:

  • If you're comfortable with code view, create a for-each loop in designer, then specify ResultSets as the input for foreach.
  • Alternatively, add a Compose card after the SQL action, choose ResultSets as the input. Then use the Output of the Compose card for for-each loop.

Upvotes: 2

Related Questions